📜  javascript htmlentities - Javascript 代码示例

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

代码示例2
var sanitizeHTML = function (str) {
    var temp = document.createElement('div');
    temp.textContent = str;
    return temp.innerHTML;
};