I want to be able to count the words within a parsed XML file. i thought i could use the code
'<span class="detail">' + $(play).find(" ").size() + '</span><span> Words</span></br>' +
to count the spaces that will tell me the amount of word but it will not count or run the statement.
what way can count the word from a parsed XML file
You don’t need jQuery to count the words in a String.
You could for example split the String on whitespaces and then count the array length like:
See the MDN page for String.split()
Considering the markup in your question you could use an approach like in this fiddle