I have a simple html text box. When I \"submit\" the form that the text box is in, I would like to get a variable with the number of words inside using Jqu
var str = $('#name').val(), count = str.split(' ').length;
Assuming that each word is seperated by a space