To use this script, place the following code in the document head:
function countWords(){
document.form1.wordcount.value = document.form1.inputString.value.split(' ').length;
}
Place the following code in the document body:
You can adapt this script to count words is whichever way you like. The important part is inputString.value.split(' ').length — this counts the spaces.
Sunday, May 13, 2007
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment