Agrega ejercicio 1 de la clase 9

This commit is contained in:
Lucio Gaibazzi
2026-05-30 20:29:41 -03:00
parent ddefc238dc
commit 94cb1595d1
2 changed files with 13 additions and 0 deletions

View File

@@ -1 +1,12 @@
// Agregar acá el código javascript para los ejercicios // Agregar acá el código javascript para los ejercicios
//Ejercicio 1 de la clase 9
let clicks = 0;
const boton = document.querySelector("#botonEjc1");
const parrafo = document.querySelector("#textoContador");
boton.addEventListener("click", function(){
clicks++;
parrafo.textContent = `Botón clickeado ${clicks} veces`;
});

View File

@@ -10,6 +10,8 @@
<h1>Clase 9 - Eventos</h1> <h1>Clase 9 - Eventos</h1>
<div id="ejercicio-1"> <div id="ejercicio-1">
<!-- Agregar acá el código HTML que haga falta para el ejercicio 1 --> <!-- Agregar acá el código HTML que haga falta para el ejercicio 1 -->
<button id="botonEjc1">Click</button>
<p id="textoContador">Botón clickeado 0 veces</p>
</div> </div>
<hr> <hr>
<div id="ejercicio-2"> <div id="ejercicio-2">