Created
November 16, 2015 09:35
-
-
Save think2011/96813ed93992159c242c to your computer and use it in GitHub Desktop.
反转义HTML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 反转义HTML | |
* @param str | |
* @returns {string} | |
*/ | |
function decodeHtml (str) { | |
var temp = document.createElement('div'); | |
temp.innerHTML = str; | |
return temp.innerText; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment