From 2008e7f87f581d79c726ab7259303d4224edca27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Blas=20Alarc=C3=B3n?= <47840816@terciariourquiza.edu.ar> Date: Thu, 21 May 2026 19:04:05 -0300 Subject: [PATCH] Agregue un boton y un parrafo que dice cuantas veces se clickeo --- clase-9.js | 9 +++++++++ index.html | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/clase-9.js b/clase-9.js index 6df1007..ec87ff6 100644 --- a/clase-9.js +++ b/clase-9.js @@ -1 +1,10 @@ // Agregar acá el código javascript para los ejercicios +const boton = document.querySelector("button"); +const parrafo = document.querySelector("p"); +var i = 0 + +boton.addEventListener("click", function () { + i = i + 1 + parrafo.textContent = `Este boton ha sido clickeado ${i} veces`; + console.log(`El botón fue clickeado ${i} veces`); +}); \ No newline at end of file diff --git a/index.html b/index.html index 2a6b85f..f27efa8 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,8 @@
Este boton ha sido clickeado 0 veces