17-10-2011

Javascript Strip HTML tags with JavaScript

If your using JavaScript in a browser it can be as simple as this:

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

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

Keywords: innerHTML striptags

Comments:

Your comment:

»

 

[x]