Wednesday, September 24, 2008

Removing HTML tags from strings in Javascript

To remove html tags from a string use following code snippet:

function StripHTMLTags(strSrc)
{
strSrc.replace( /<[^<|>]+?>/gi,'' );
}

No comments: