feat: add character count functionality to text input

This commit is contained in:
2026-05-20 16:03:21 -03:00
parent 0b8e8b5bd7
commit b97fb32d67
2 changed files with 52 additions and 31 deletions

View File

@@ -11,3 +11,12 @@ clickButton.addEventListener('click', () => {
count++;
clickCounter.textContent = count;
});
// Ejercicio 2
const textInput = document.getElementById('textInput');
const charCount = document.getElementById('charCount');
textInput.addEventListener('input', () => {
charCount.textContent = textInput.value.length;
});