September 14, 2010

Javascript: strip HTML tags from a string

Here's a super simple RegEx to use when you want to be sure all html tags are removed from a string.
theString.replace(/<.*?>/g, '');

No comments:

Post a Comment