Skip to main content
CodeOath
← All challenges

Challenge

Live Character Counter + Validation

Medium
  • javascript
  • forms
  • dom

Build a text area with a live character counter under it, written like 42/140. Past 140 characters the counter turns red and the submit button is disabled.

Notes:

  • The starter has #input, #counter and #submit-btn. The counter starts at 0/140.
  • Exactly 140 characters is still allowed. The 141st character is the one that tips it over.

Check your work against

  • The counter updates on every keystroke, not just on submit
  • The counter visually changes color (e.g. to red) once the limit is exceeded
  • The submit button is disabled while over the limit, and re-enabled once back under it
  • Works correctly if the user pastes text in, not just types it

No automatic grading

Check your work against the list above, then compare it with the solution preview.

Tab indents. Press Esc, then Tab to leave the editor.

Live preview

Starter loaded. The preview updates as you type.