📜  剥离 html 标签 javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:15.233000             🧑  作者: Mango

代码示例4
function stripHtml(html)
{
   let tmp = document.createElement("DIV");
   tmp.innerHTML = html;
   return tmp.textContent || tmp.innerText || "";
}