From 47730f361fad879cc564028ac3ee5205592c5036 Mon Sep 17 00:00:00 2001 From: Bruno Date: Wed, 27 May 2026 20:02:55 -0300 Subject: [PATCH] Resolucion del 2do ejercicio --- clase-9.js | 12 ++++++++++-- index.html | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) 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