This plugin integrates by default with Twitter bootstrap using badges to display the maximum lenght of the field where the user is inserting text. Uses the HTML5 attribute "maxlength" to work.
Project Page github.com Page
default input with maxlength equal 20
Input with threshold equal 20
Textarea with threshold equal 40