I need to put the words of a text area into a JavaScript array. I've got it working right up to the crucial point. I've written a function to count the words, but that didn't really help as I need to count the words by using array.length
or whatever the property may be.
<html>
<head>
<title>My Test Form</title>
</head>
<body>
<textarea cols="80" rows="15" id="words" name="words">
</textarea>
<br/>
<br/>
<br/>
<br/>
<script>
function get_words()
{
var x = document.getElementById("words").value;
return x;
}
function put_words_into_array()
{
var w = get_words();
var a = /// need code here to put words of the string into array
}
</script>
</body>
</html>