About

Uses Twitter's Bootstrap classes as defaults.

Usage


        $("#textbox").lilCharacterCount();
      
As used in demo:

        $("#textbox").lilCharacterCount({
          limit: 100,
          warning: 50,
          submitButton: "submit-button"
        });
      

Options

limit
Number. Sets the character limit for the text box. Default: 140
warning
Number. Toggles the warning class on the counter when this character count is reached. When set to 0, it is disabled. Default: 100
allowExceed
Boolean. Determines whether or not typing is allowed past the limit. Default: true
submitButton
String. ID of submit button that, if supplied, will be disabled if limit is exceeded. Default: blank
counterClass
String. Class for the counter. Default: character-count
defaultClass
String. Class applied to counter when the character warning or limit values haven't been exceeded. Default: bg-info
warningClass
String. Class applied to counter when the character warning values have been exceeded. Default: bg-warning
dangerClass
String. Class applied to counter when the character limit value has been exceeded. Default: bg-danger