This little jQuery snippet will let you quickly add a limit counter to input fields to display available remaining characters. A nice feature to include for improved user experience.
To setup the limiter, simply include a call similar to the one below:
var elem = $("#chars");
$("#text").limiter(100, elem);
The first parameter is the character limit integer and the second is a jQuery element representing the target object to display the characters remaining. This is not a replacement for the maxlength parameter or server-side validation, just a visual way to represent the limit.
Thanks so much for this little gem!
I’ve tried other character counters but this was the lightest and easiest to implement of all those I’ve tried!
Love it
THanks for code..
this is good article.
For dynamic & Responsive website, please contact
This doesn’t work if there are several consecutive enter characters. It limits too early.
Very handy! Thanks. It works perfectly.
I have tried and used many character limit & counters but this one is really very light, handy and works on copy & paste too… Great Job!