Javascript: Calculate Characters Remaining In A TextArea

In this post, we'll create a Javascript event listener that calculates the number of characters that have been entered in a TextArea. The purpose here is not to demonstrate the quick and dirty solution, but rather to fully understand how the code actually works. This functionality is helpful for inline form validation and preventing users from hitting the server-side with invalid data.