Ejercitación sobre la Clase 9 #10

Open
gaibazzi.lucio wants to merge 5 commits from gaibazzi.lucio/clase-9-eventos:eventos into main
2 changed files with 13 additions and 0 deletions
Showing only changes of commit f8ec466ac7 - Show all commits

View File

@@ -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}`;
});

View File

@@ -16,6 +16,8 @@
<hr>
<div id="ejercicio-2">
<!-- Agregar acá el código HTML que haga falta para el ejercicio 2 -->
<input type="text" id="texto">
<p id="cantidadCaracteres">Cantidad de caracteres: 0</p>
</div>
<hr>
<div id="ejercicio-3">