clase 9 #3

Open
alarcon.blas wants to merge 5 commits from alarcon.blas/clase-9-eventos:blas-alarcon into main
2 changed files with 11 additions and 1 deletions
Showing only changes of commit 2008e7f87f - Show all commits

View File

@@ -1 +1,10 @@
// Agregar acá el código javascript para los ejercicios
const boton = document.querySelector("button");
const parrafo = document.querySelector("p");
var i = 0
boton.addEventListener("click", function () {
i = i + 1
parrafo.textContent = `Este boton ha sido clickeado ${i} veces`;
console.log(`El botón fue clickeado ${i} 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>Haz click</button><!-- Agregar acá el código HTML que haga falta para el ejercicio 1 -->
<p>Este boton ha sido clickeado 0 veces</p>
</div>
<hr>
<div id="ejercicio-2">