strip tag html javascript code example
Example 1: how to strip html tags in javascript
function stripHtml(html)
{
let tmp = document.createElement("DIV");
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || "";
}
Example 2: js strip_tags
let strippedString = originalString.replace(/(<([^>]+)>)/gi, "");