diff --git a/clase-9.js b/clase-9.js index 5014129..d7418b1 100644 --- a/clase-9.js +++ b/clase-9.js @@ -1,8 +1,16 @@ // Agregar acá el código javascript para los ejercicios //ejercicio 1 const boton = document.querySelector("#boton"); -let contadorClicks = 0 +let contadorClicks = 0; boton.addEventListener("click", () => { contadorClicks = contadorClicks + 1; - boton.textContent = `Botón clickeado ${contadorClicks} veces` + boton.textContent = `Botón clickeado ${contadorClicks} veces`; +}) + +//ejercicio 2 +const campo = document.querySelector("#input2"); +const resultado = document.querySelector("#resultado"); +campo.addEventListener("input", () => { + const cantidad = campo.value.length; + resultado.textContent = `Caracteres: ${cantidad}`; }) \ No newline at end of file diff --git a/index.html b/index.html index 6214d56..142cc6f 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,8 @@
- + +

Caracteres: 0