Tag: html
Strip HTML from a string in JavaScript
by admin on May.20, 2011, under Web Development
Nice handy way of removing all HTML from a string using on JavaScript:
variable.replace(/<.*?>/g, '');
There are other ways of doing this, but they rely on the presence of a web browser. This should work in most modern JS engines.