Monday, May 22, 2017

strip HTML tags from string

var html = "<p>Some HTML</p>";
var div = document.createElement("div");
div.innerHTML = html;
var text = div.textContent || div.innerText || ""; 
or
cleanText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
 
@reference_1_stackoverflow

No comments:

Post a Comment