so I have a text area that I am trying to limit the word count on. So far I have this in the body
<textarea id="theTextArea" rows="10" cols="50"></textarea>
and this function
function checkWordCount()
{
var currStr = theTextArea.value;
var tokens = currStr.split(" ");
var numWords = tokens.length;
wordCount.innerHTML = numWords;
if (numWords > 24) {
document.getElementById("theTextArea").disabled = true;
}
}
The problem with this is I need the user to be able to delete words and add new ones if they need to. This just disables it after 24 words and they can't modify it anymore