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