EJ3 terminado

This commit is contained in:
2026-05-26 18:51:50 -03:00
parent 43d20f2ac5
commit fc768f3aa0
2 changed files with 10 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
1// 1//
const botonContador = document.getElementById("contador-btn"); const botonContador = document.getElementById("contador-btn");
const parrafoContador = document.getElementById("contador-parrafo"); const parrafoContador = document.getElementById("contador-parrafo");
let contador = 0; let contador = 0;
@@ -9,3 +10,10 @@ botonContador.addEventListener("click", () => {
}); });
2// 2//
const cajaTexto = document.getElementById("text-cont");
const conatdorLetras = document.getElementById("contador-text")
let Letras = 0;
cajaTexto.addEventListener("input", () => {
Letras += 1;
conatdorLetras.textContent = `Letras escritas = ${Letras} `;
});

View File

@@ -15,7 +15,8 @@
<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 -->
<input type="text" id="nombre-input" placeholder="Escribe algo"> <input type="text" id="text-cont" placeholder="Escribe algo">
<p id="contador-text">Letras escritas = 0</p>
</div> </div>
<hr> <hr>
<div id="ejercicio-3"> <div id="ejercicio-3">