Word count percentage
How do I make an word count percentage?
Count words, count finds, show the stats. An easy SEO tool. What is a word count percentage? How do you make a word count percentage? This script and codes were developed by Luuk Lamers on 09 January 2023, Monday.
Word count percentage - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Word count percentage</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ *{box-sizing:border-box;}
body{font-family:Roboto, sans-serif;font-size:16px;background:#f9f9f9;}
input,textarea{font-size:16px;padding:5px;margin:0;font-family:Roboto, sans-serif;border:1px solid black;display:block;width:400px;}
textarea{height:200px;}
input{height:30px;display:block;width:100%;}
table{width:450px;margin:30px auto 0 auto;} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <table> <tr> <td>Keywords</td> <td><input type="text" id="keywords" value="lorem ipsum" /></td> </tr> <tr> <td valign="top">Text</td> <td><textarea>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus convallis, orci vitae tincidunt congue, tellus purus vehicula velit, in molestie. lorem.</textarea></td> </tr> <tr> <td></td> <td align="right"><span class="count">wordcount</span> words</td> </tr> <tr> <td></td> <td align="right"><span class="finds">wordcount specific</span> find(s)</td> </tr> <tr> <td></td> <td align="right"><span class="percent">wordpercentage</span>%</td> </tr> <tr> <td></td> <td align="right">percentage has to be between 3% and 5%</td> </tr>
</table> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Word count percentage - Script Codes CSS Codes
*{box-sizing:border-box;}
body{font-family:Roboto, sans-serif;font-size:16px;background:#f9f9f9;}
input,textarea{font-size:16px;padding:5px;margin:0;font-family:Roboto, sans-serif;border:1px solid black;display:block;width:400px;}
textarea{height:200px;}
input{height:30px;display:block;width:100%;}
table{width:450px;margin:30px auto 0 auto;}
Word count percentage - Script Codes JS Codes
jQuery(document).ready(function(){ function occurrences(string, subString, allowOverlapping){ string+=""; subString+=""; if(subString.length<=0) return string.length+1; var n=0, pos=0; var step=(allowOverlapping)?(1):(subString.length); while(true){ pos=string.indexOf(subString,pos); if(pos>=0){ n++; pos+=step; } else break; } return(n);
} function countStuff(){ var content = $('textarea').val().toLowerCase(); var keywords = $("input").val().trim().toLowerCase().split(' '); var numOfWords = content.replace(/^[\s,.;]+/, "").replace(/[\s,.;]+$/, "").split(/[\s,.;]+/).length; $(".count").html(numOfWords); var numOfFinds = 0; $.each(keywords,function(index,value){ console.log(value); numOfFinds += occurrences(content,value); }); $(".finds").html(numOfFinds); var percentage = (numOfFinds / numOfWords) * 100; $(".percent").html(percentage); } $("textarea, input").on("keydown keyup", function(){countStuff()}); $("window").on("load", countStuff());
});
Developer | Luuk Lamers |
Username | xaddict |
Uploaded | January 09, 2023 |
Rating | 3 |
Size | 2,793 Kb |
Views | 6,072 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Fibonacci rotating spiral | 2,519 Kb |
Flexbox layout sidebars and content | 5,099 Kb |
Draw SVG polygon points in css | 2,720 Kb |
SVG animated patterns | 2,463 Kb |
3D valve | 2,396 Kb |
Lazyload with SVG | 2,977 Kb |
Continuum | 2,307 Kb |
Bubble Pop Menu | 4,655 Kb |
Responsive off-canvas dual-side navigation without transforms | 5,287 Kb |
Big Chat | 3,492 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Perspective Origin Demo | Agelber | 3,614 Kb |
Angular Route | Arun_v606 | 1,837 Kb |
Pure CSS Read More Arrow | Zephyr | 1,747 Kb |
Tumblr API | Juanv911 | 2,436 Kb |
Toggle menu | Seyedi | 2,279 Kb |
Calendar | Miroot | 2,033 Kb |
Obligatory CSS3 UI Nav | Romandiaz | 9,017 Kb |
Whyutils | LeYvan | 3,752 Kb |
SCSS Simple Animated Drop-In | Danwarfel | 2,175 Kb |
CodeCamp Tribute Page | JonathanDeJesus | 6,860 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!