diff --git a/clase-9.js b/clase-9.js index 6df1007..217d83c 100644 --- a/clase-9.js +++ b/clase-9.js @@ -1 +1,9 @@ -// Agregar acá el código javascript para los ejercicios +// Ejercicio 1 - Contador de clics +let clickCount = 0; +const boton = document.getElementById('miBoton'); +const parrafo = document.getElementById('contadorClicks'); + +boton.addEventListener('click', function() { + clickCount++; + parrafo.textContent = `Botón clickeado ${clickCount} veces`; +}); diff --git a/index.html b/index.html index 2a6b85f..6ba8d93 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,8 @@

Clase 9 - Eventos

- + +

Botón clickeado 0 veces