Skip to main content
100%

Character Count

✓ Published0🌍 Public
Aangusgrant
Last edited Oct 17, 2022
Created on Oct 17, 2022

A textarea accepts user input and displays a live character count beneath it, updating as the user types or deletes. The page shows the current number of characters in bold, starting at zero when the field is empty. The code uses the browser’s native DOM `input` event and `event.target.matches()` to detect changes to the textarea, then updates the `#character-count` span’s text content via `document.querySelector()`. No external libraries are used; only plain JavaScript and HTML.

AI-generated description

Similar vizzes