I built a form that is depentent on a word count a word count. What I have works just fine in IE but doesn't work in Firefox. It changes the count from 0 to 1 and that's as far as it goes. Here's what I'm doing.
Does anyone know what I can do to make it work in Firefox? I haven't tried it in anything else, so if there's a universal fix, that would be helpful!
Code:
<script type=text/javaScript>
<!--
function word_count(val) {
val = val.split(/\s+/g);
document.form.op3.value = val.length;
}
//-->
</script>
<form name="form">
<textarea onkeyup="word_count(this.innerHTML)" name="adtext" rows="12" cols="85"></textarea>
<br />
<p>Word Count:
<input readonly="readonly" size="3" value="0" name="op3" /></p>
</form>
Comment