-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
15 lines (13 loc) · 965 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SimpleMaxChars jQuery plugin v1.0
Author: Josh McCarty
Website: http://joshmccarty.com
Copyright (c)2012 Josh McCarty
License: GPL Version 2
http://www.gnu.org/licenses/gpl-2.0.txt
This plugin adds a message displaying the number of characters remaining in an input or textarea when they have a maxlength set. It's a bit rough around the edges, but I needed a fairly basic solution quickly and most of the existing plugins that offer a similar function were too big, too small, or didn't meet my specific needs. If this looks like it will work for you, feel free to use it!
Highlights:
- Less than 2KB minified.
- Uses .prop() and .attr() correctly (.attr() is often used incorrectly for setting/getting DOM properties)
- Can be used on individual elements with unique options for each element
- Can be used on multiple elements with the same options
- Message formatting function can be customized via $.fn.SimpleMaxChars.message = function(){ customFunction });