Skip to content
engineering workbench.by StudyPort Academy
All projects
Beginner20 min

Character counter

Keep a live character count and remaining allowance in sync.

Input eventsStrings

YOUR BUILD CHECKLIST

  1. Trace textarea1 to both counter elements.
  2. Type and paste text to observe the input listener.
  3. Change maxlength and verify both counters.
Editable original
Opening editor…
LIVE PREVIEW
Console 0

Your console output appears here.

Saved on this deviceJavaScript · ES2022
Notes on this source port
  • Use the input event so paste and speech input update the original counters; label the textarea and remove autofocus.

Make it your own

The original works. These are your next experiments.

  • Count Unicode code points instead of UTF-16 units.
  • Add a warning state near the limit.
Open a fresh playground