Mike Griffiths

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.

Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post.