Word count percentage

Developer
Size
2,793 Kb
Views
6,072

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 Previews

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());
});
Word count percentage - Script Codes
Word count percentage - Script Codes
Home Page Home
Developer Luuk Lamers
Username xaddict
Uploaded January 09, 2023
Rating 3
Size 2,793 Kb
Views 6,072
Do you need developer help for Word count percentage?

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!

Luuk Lamers (xaddict) Script Codes
Create amazing video scripts with AI!

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!