🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Just another jQuery plugin that displays how many characters remaining in a text field and enforces max requirement using maxlength attribute.

Character-Limit Character-Counter

Documentation

jquery.charactersRemaining

Show characters remaining on an html input with a maxlength

Example use

<!DOCTYPE html> <html> <head> </head> <body> <textarea maxlength="100"></textarea> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="jquery.charactersRemaining.js"></script> <script> jQuery('textarea').charactersRemaining(); </script> </body> </html>

Options

$('input').charactersRemaining({     className:  'charRemaining',     singleCharacterText: '## character remaining',     multipleCharacterText: '## characters remaining' });
Attribute Type Default Description
className string charRemaining Classname to apply to new element containing chracter count.
singleCharacterText string ## character remaining Text to display when there is only 1 character left
multipleCharacterText string ## characters remaining Text to display when there is not 1 character left

You May Also Like