Ejercitación sobre la Clase 9 #10
11
clase-9.js
11
clase-9.js
@@ -9,4 +9,15 @@ const parrafo = document.querySelector("#textoContador");
|
||||
boton.addEventListener("click", function(){
|
||||
clicks++;
|
||||
parrafo.textContent = `Botón clickeado ${clicks} veces`;
|
||||
});
|
||||
|
||||
|
||||
|
||||
//Ejercicio 2 de la clase 9
|
||||
|
||||
const campo = document.querySelector("#texto");
|
||||
const contadorCaracteres = document.querySelector("#cantidadCaracteres");
|
||||
|
||||
campo.addEventListener("input", function() {
|
||||
contadorCaracteres.textContent = `Cantidad de caracteres: ${campo.value.length}`;
|
||||
});
|
||||
@@ -16,6 +16,8 @@
|
||||
<hr>
|
||||
<div id="ejercicio-2">
|
||||
<!-- Agregar acá el código HTML que haga falta para el ejercicio 2 -->
|
||||
<input type="text" id="texto">
|
||||
<p id="cantidadCaracteres">Cantidad de caracteres: 0</p>
|
||||
</div>
|
||||
<hr>
|
||||
<div id="ejercicio-3">
|
||||
|
||||
Reference in New Issue
Block a user