2 Commits

Author SHA1 Message Date
61ce091c00 Ejercicio 2 2026-06-01 21:06:57 -03:00
83b512ab94 Ejercicio 1 2026-06-01 20:37:22 -03:00

View File

@@ -10,10 +10,36 @@
<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="boton">Clickea aca</button>
<p id="contador">Hiciste 0 clicks</p>
<script>
let contador = 0;
const miboton = document.getElementById("boton");
const parrafo = document.getElementById("contador");
boton.addEventListener("click", () => {
contador++,
parrafo.textContent = `Hiciste ${contador} clicks`;
}
)
</script>
</div> </div>
<hr> <hr>
<div id="ejercicio-2"> <div id="ejercicio-2">
<!-- Agregar acá el código HTML que haga falta para el ejercicio 2 --> <!-- Agregar acá el código HTML que haga falta para el ejercicio 2 -->
<label for="texto">Ingrese sus caracteres </label>
<input type="text" id="miTexto" name="miTexto" rows="4" cols="50" placeholder="Ingrese algo aqui...">
<p id="contador2">Ingresaste 0 cantidad de caracteres</p>
<script>
const campo = document.querySelector("input");
const parrafo2 = document.getElementById("contador2");
campo.addEventListener("input", () => {
const cantidadCaracteres = campo.value.length;
parrafo2.textContent = `Ingresaste esta cantidad ${cantidadCaracteres} de caracteres`;
})
</script>
</div> </div>
<hr> <hr>
<div id="ejercicio-3"> <div id="ejercicio-3">