去除一段字符串中的HTML标签

http://stackoverflow.com/questions/822452/strip-html-from-text-javascript

function strip(html)
{
   var tmp = document.createElement("DIV");
   tmp.innerHTML = html;
   return tmp.textContent || "";
}

你可能感兴趣的:(去除一段字符串中的HTML标签)