This time I will share jQuery Plugin and tutorial about Calculate Word Count And Average Word Length – Text Analyzer, hope it will help you in programming stack.
A small jQuery based online Text Analyzer Tool to show the detailed statistics of your text: word count, unique word count, and average word length.
How to use it:
1. Create a textarea to accept the text you’d like to analyze.
1 |
< form class = "js-text-form" > |
3 |
< label for = "user-text" >Text to analyze</ label > |
4 |
< textarea id = "user-text" name = "user-text" placeholder = "Paste Your Text Here" required></ textarea > |
7 |
< button type = "submit" >Analyze it!</ button > |
2. Create the HTML for the the detailed statistics of your text.
01 |
< dl class = "hidden text-report js-text-report" > |
03 |
< dd class = "js-word-count" ></ dd > |
05 |
< dt >Unique word count</ dt > |
06 |
< dd class = "js-unique-word-count" ></ dd > |
08 |
< dt >Average word length</ dt > |
09 |
< dd class = "js-average-word-length" ></ dd > |
3. Download the plugin and import the app.js
into the web page and done.
2 |
< script src = "/path/to/cdn/jquery.min.js" ></ script > |
4 |
< script src = "/path/to/app.js" ></ script > |
This awesome jQuery plugin is developed by amarttala. For more Advanced Usages, please check the demo page or visit the official website.