Is there an easy way to take a string of html in JavaScript and strip out the html?
var text = html.replace(/<\/?("[^"]*"|'[^']*'|[^>])*(>|$)/g, "");
This is a regex version, which is more resilient to malformed HTML, like:
Unclosed tags
Some text
"<", ">" inside tag attributes
Some text
Newlines
The code
var html = '
This is > \nmy<>< > "text"])*(>|$)/g, "");