Here is my markup:
<body>
<div id="headbox">
<p>Whatever...</p>
</div>
<div id="feed">
<div>
<p>I hate cats</p>
</div>
<div>
<p>I like cats</p>
</div>
<div>
<p>I like cats</p>
</div>
<div>
<p>I like cats</p>
</div>
</div>
</body>
The deal is I need a script that counts all words which appear in the <div id="feed">.
The output should be wrapped in <p> tags or <span> tags.
<h3>The top 3 used words in this feed:</h3>
1. <p>cats</p> 4x
2. <p>like</p> 3x
3. <p>hate</p> 1x
This would be the output.
As you can see the word (or better the letter) I was not considered. Every word under 3 letters will be not considered by the counting.
Just loop through the innerHTMLs, split the text on spaces, and use each value of the resulting array to add to or update a master array indexed by the words found with values being the counts of the words.