suppose i am getting HTML text in my JavaScript function as
var TEMP= result.data;
where result.data='<p>BODY Article By Archie(Used By Story Tool)</p>';
i have done this:
var e = document.createElement("span");
e.innerHTML = TEMP;
var text = e.innerText;
var characterCount = text.length;
var wordCount = text.match(/\b\w/g).length;
but this code doesn't work in mozilla firefox i have also tried o.k.w s code but didn't work in mozilla
and i also need the number of words i want to read the number of characters in TEMP,
and while doing that i want to skip HTML tags and html keywords (ex.
)
pls help
and important this should work on mozilla firefox browser.