diff --git a/clase-9.js b/clase-9.js index a3d6541..1ce769c 100644 --- a/clase-9.js +++ b/clase-9.js @@ -11,3 +11,12 @@ clickButton.addEventListener('click', () => { count++; clickCounter.textContent = count; }); + +// Ejercicio 2 + +const textInput = document.getElementById('textInput'); +const charCount = document.getElementById('charCount'); + +textInput.addEventListener('input', () => { + charCount.textContent = textInput.value.length; +}); diff --git a/index.html b/index.html index 517f21e..c8b10b9 100644 --- a/index.html +++ b/index.html @@ -1,33 +1,45 @@ - - - - Clase 9 - Eventos - - - -

Clase 9 - Eventos

-
-

Este boton ha sido clickeado 0 veces

- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
- - - + + + + + Clase 9 - Eventos + + + + +

Clase 9 - Eventos

+
+

Este boton ha sido clickeado 0 veces

+ +
+
+
+ + + + +

+ Caracteres ingresados: + 0 +

+
+
+
+ +
+
+
+ +
+
+
+ +
+ + + + \ No newline at end of file