html实体字符转换成字符串

function EntityToString(value) { 
    let Tag = document.createElement("div"); 
    Tag.innerHTML = value; 
    let strCode = Tag.innerText || Tag.textContent; 
    Tag = null; 
    return strCode; 
} 

猜你喜欢

转载自www.cnblogs.com/gionlee/p/12069126.html