ejercicio 1: contador de clicks con addEventListener

This commit is contained in:
2026-05-24 14:37:45 -03:00
parent ddefc238dc
commit 63f8bb23a3
2 changed files with 11 additions and 2 deletions

View File

@@ -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`;
});