This repository has been archived by the owner on Nov 28, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
jQuery plugin that limits the number of words in a form element.
jom/jquery-limitwords
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
/* * jQuery limitWords Plugin * * Licensed under The MIT License * Redistributions of files must retain the copyright notice. * * @copyright Copyright 2010 Jacob Morrison <jomorrison gmail com>, http://projects.ofjacob.com * @license http://www.opensource.org/licenses/mit-license.php The MIT License * @author Jacob Morrison <jomorrison gmail com> */ Basic Usage for <textarea id="myTextarea"></textarea> element: $("#myTextarea").limitWords(); Options ================================= leftSelector: element you want to have updated with the number of words left (default: false) limit: number of words you want to allow (default: 250) underColor: when leftSelector is set, color to set when input is under the limit (default: green) atColor: when leftSelector is set, color to set when input is at the limit (default: orange) Example with Counter Element ================================= (in body somewhere) <textarea id="myTextarea"></textarea> (Word limit: 100, <span id="myTextarea_left"></span>) (in head) <script type="text/javascript"> //<![CDATA[ $(function(){ $("#myTextarea").limitWords({leftSelector: '#myTextarea_left', limit: 100, underColor: 'blue'}); }); //]]> </script>
About
jQuery plugin that limits the number of words in a form element.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published