Count Characters Left

Write the code, see it run, pass the checks.

The problem

  • easy
  • Code

A status box has a textarea labelled "Status" and a "Post" button. Under it, show how many of the 40 allowed characters are left: "40 characters left" when it's empty, "35 characters left" after typing "Hello". Past 40, show how many too many instead, e.g. "3 characters too many" for 43 characters. Post is disabled while the status is empty or too long.

Your code must pass

  • Shows 40 characters left at first, with Post disabled
  • Typing counts down and enables Post
  • Over 40 characters says how many too many and disables Post