Count Words Using JavaScript

Share:



Count Words Using JavaScript

Counting the number of words in a block of text is quite simple with JavaScript. The idea is to count the number of spaces and use this to calculate the number of words. The following example illustrates the script.
Function:

HTML Example:

Hi! I am Sartaj Husain. I am a Professional Software Developer, live in Delhi. I write blogs in my free time. I love to learn and share the knowledge with others because it is no good to try to stop knowledge from going forward. So free posts and tutorials. more..

No comments