Compare commits

..

1 Commits

Author SHA1 Message Date
63f8bb23a3 ejercicio 1: contador de clicks con addEventListener 2026-05-24 14:37:45 -03:00
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`;
});

View File

@@ -9,7 +9,8 @@
<body>
<h1>Clase 9 - Eventos</h1>
<div id="ejercicio-1">
<!-- Agregar acá el código HTML que haga falta para el ejercicio 1 -->
<button id="miBoton">Hacer clic</button>
<p id="contadorClicks">Botón clickeado 0 veces</p>
</div>
<hr>
<div id="ejercicio-2">