Fork me on GitHub

jquery.charcounter


A simple character counter plugin for jQuery using Bootstrap from Twitter

Works with:

input[type=text]



Markup
<input type="text" data-countable="1" data-limit="100"> 

textarea



Markup
<textarea rows="5" data-countable="1" data-limit="20"></textarea> 
Javascript
$('[data-countable]').charcounter({
  limit: 140,
  warning: 15,
  warningClass: 'label-warning',
  exceededClass: 'label-important',
  defaultClass: 'label-info',
  notAllowOverflow: true,
  fontSize: '1.4em',
})