This time I will share jQuery Plugin and tutorial about Max Character Limit Plugin For Textarea, hope it will help you in programming stack.
Yet another character limit jQuery plugin that limits the character length and counts the number (percentage) of characters left (used) for textarea elements.
How to use it:
1. Download and include the JavaScript file textarea_MaxCharacterLimit.js
after loading jQuery library.
2 |
integrity = "sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" |
3 |
crossorigin = "anonymous" > |
5 |
< script src = "textarea_MaxCharacterLimit.js" ></ script > |
2. Create a container element to hold the character limit message.
1 |
< span id = "ContentCountPercentLeft" ></ span > |
3. Initialize the plugin on the target textarea element and specify the max length of the textarea.
- totalCharsAllowed: total characters allowed
- textareaIdentifier: textarea ID
- spanId: counter ID
1 |
< textarea name = "example" id = "example" ></ textarea > |
2 |
textarea_MaxCharacterLimit(140, 'example' , 'counter' ); |
This awesome jQuery plugin is developed by 4cm. For more Advanced Usages, please check the demo page or visit the official website.