Ejercitación sobre la Clase 9 #10

Open
gaibazzi.lucio wants to merge 5 commits from gaibazzi.lucio/clase-9-eventos:eventos into main
2 changed files with 13 additions and 0 deletions
Showing only changes of commit 94cb1595d1 - Show all commits

View File

@@ -1 +1,12 @@
// 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>
<div id="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>
<hr>
<div id="ejercicio-2">