jQuery TextCounter Plugin

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.

Fork me on GitHub

Usage

jQuery TextCounter is extremely easy to use. Below is a very basic example. You can read more under the configuration options section.

  1. Ensure you have jQuery ~1.9.2 or equivalent loaded on your page.
  2. Using the example below, plug in your own configuration parameters:

Configuration Options

Initialize the TextCounter plugin with any of the following configuration options passed in as the first parameter's object.

Downloads

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
  • wget https://github.com/cballou/jQuery-textCounter-Plugin/archive/master.zip
  • wget https://github.com/cballou/jQuery-textCounter-Plugin/archive/master.tar.gz

Support

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

License

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.

Changelog

  • May 16, 2016
    Added the MIT License for clarity.
  • Sep 8, 2012
    Initial commit.

About the Author

is a full-stack web applications developer in Charlotte, NC with 9+ years professional experience. He holds a bachelors degree in Computer Science and has been working remotely since 2012. He specializes in LAMP/LEMP stack development with Laravel and WordPress. Corey is the owner and principal consultant at Craft Blue, a custom web applications development consultancy. He's also the co-organizer of the Queen City PHP meetup group in Charlotte. He is an entrepreneur, blogger, open source contributor, beer lover, startup advocate, chicken wrangler, hydroponics gardening dabbler, and homebrewer.

Corey works with agencies, startups, and businesses.

Contact Corey to see how Craft Blue can help you.