Fork me on GitHub

jsHtml解码

//将HTML代码转换为文本
function HTMLDecode(text) {
var temp = document.createElement("div");
temp.innerHTML = text;
var output = temp.innerText || temp.textContent;
temp = null;
return output;
}

posted @ 2021-07-13 15:26  WantRemake  阅读(128)  评论(0编辑  收藏  举报