TextCounter is a tiny (104 loc commented) jQuery plugin for handling input, textarea, and contentEditable countdowns. In other words, this plugin will calculate either word lengths or string lengths. Common use cases for such a plugin are when you want to validate the maximum length of form inputs in realtime and display the remaining character or word count to the end user. This plugin is commonly associated with social media posting based on their character restrictions.
The plugin is easily configurable and modifiable based on your needs.
jQuery TextCounter is extremely easy to use. Below is a very basic example. You can read more under the configuration options section.
Initialize the TextCounter plugin with any of the following configuration options passed in as the first parameter's object.
Downloads are available via WordPress. Source code is available via Github.
git clone https://github.com/cballou/jQuery-textCounter-Plugin.git
git clone [email protected]:cballou/jQuery-textCounter-Plugin.git
If you have any problems with TextCounter, please file a ticket/issue/bug on Github and I will attempt to address it at my earliest convenience.TextCounter Issues on Github
TextCounter is licensed under the MIT License.
The MIT License is simple and easy to understand and it places almost no restrictions on what you can do with TextCounter.
You are free to use TextCounter in commercial projects as long as any copyright headers and license file are left intact.