Inicio de la clase 9 #9

Open
maderademarco.sergio wants to merge 6 commits from maderademarco.sergio/clase-9-eventos:ejercicio-9 into main
2 changed files with 11 additions and 2 deletions
Showing only changes of commit 63f8bb23a3 - Show all commits

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">