Character Count in Textarea
Count the character of a textarea and show the number to exceed the limit.
HTML
<label for="description">Description:</label>
<br>
<textarea name="description" id="description" cols="60" rows="5" maxlength="5" placeholder="Describe about something..."></textarea>
<div id="characterLeft"></div>
JavaScript
$('#characterLeft').text('255 characters left');
$('#description').keyup(function () {
var max = 255;
var len = $(this).val().length;
if (len >= max) {
$('#characterLeft').text(' you have reached the limit');
} else {
var ch = max - len;
$('#characterLeft').text(ch + ' characters left');
}
});