Thursday, June 28, 2007

Stripping out HTML tags with JavaScript

strContent = strContent.replace(/&(ltgt);/g, function (strMatch, p1){
return (p1 == "lt")? "<" : ">"; });
strContent = strContent.replace(/<\/?[^>]+(>$)/g, "");

No comments: