Here's a character counter code that I have. It's showing how many characters remaining.
HTML:
<textarea></textarea> <span id='remainingC'></span>
JS:
$('textarea').keypress(function(){
if(this.value.length > 300){
return false;
}
$("#remainingC").html((300 - this.value.length)+ "/ 300");
});
But I have one problem. When I backspace, the number showing doesn't reflect and only when I start writing then the counter updates.
Any help would be appreciated!