forked from marquez.juan/clase-9-eventos
Agrega ejercicio 2 de la clase 9
This commit is contained in:
11
clase-9.js
11
clase-9.js
@@ -9,4 +9,15 @@ const parrafo = document.querySelector("#textoContador");
|
||||
boton.addEventListener("click", function(){
|
||||
clicks++;
|
||||
parrafo.textContent = `Botón clickeado ${clicks} veces`;
|
||||
});
|
||||
|
||||
|
||||
|
||||
//Ejercicio 2 de la clase 9
|
||||
|
||||
const campo = document.querySelector("#texto");
|
||||
const contadorCaracteres = document.querySelector("#cantidadCaracteres");
|
||||
|
||||
campo.addEventListener("input", function() {
|
||||
contadorCaracteres.textContent = `Cantidad de caracteres: ${campo.value.length}`;
|
||||
});
|
||||
Reference in New Issue
Block a user