You are here: irt.org | FAQ | JavaScript | Text | Q1619 [ previous next ]
Larry Seltzer writes:
<script language="JavaScript"><!-- function wordcount(string) { var a = string.split(/\s+/g); // split the sentence into an array of words return a.length; } //--></script>