word counting with specific word exceptions


I have javascript code to count words in a Textarea. How is it possible to have it NOT COUNT specific words, or look for specific words and subtract them from the count. Specific code or ideas on how to accomplish this is welcome.
Here's the code that I'm using now to count the words, but this counts all words. I want to say exempt words like " the" "and" "or" etc.. etc....


function cnt(w,x){
var y=w.value;
var r = 0;

var c = 0;

a=y.replace(/s/g,' ');
a=a.split(' ');
for (z=0; z 0) r++;}

// working form

Word Count:



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!