feat: add character count functionality to text input
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user