clase 9 #3
@@ -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`);
|
||||
});
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user