diff --git a/clase-9.js b/clase-9.js index 6df1007..4a3d9a4 100644 --- a/clase-9.js +++ b/clase-9.js @@ -1 +1,11 @@ -// Agregar acá el código javascript para los ejercicios +1// +const botonContador = document.getElementById("contador-btn"); +const parrafoContador = document.getElementById("contador-parrafo"); +let contador = 0; + +botonContador.addEventListener("click", () => { + contador += 1; + parrafoContador.textContent = `Botón clickeado ${contador} veces.`; +}); + +2// diff --git a/index.html b/index.html index 2a6b85f..8211f43 100644 --- a/index.html +++ b/index.html @@ -9,11 +9,13 @@
Botón clickeado 0 veces.