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

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

Categories: Snippets

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *