An HTML text input has an attribute called \"maxlength\", implemented by browsers, which if set blocks user input after a certain number of characters.
An HTML texta
Here's a jQuery plugin that I use called "Simply Countable" that allows you to add a counter to a textarea. One of the features is that it allows you to set a maximum number of characters that are allowed in a field and it enforces it so the user can't exceed that limit.
Here's the GitHub page for Simply Countable:
https://github.com/aaronrussell/jquery-simply-countable/
You would use it like this...
$('#my_textarea').simplyCountable({
counter: '#counter',
maxCount: 140,
strictMax: true
});