Created
April 8, 2016 01:18
-
-
Save jeserodz/b54130dead86cc0e2db4735deb3b8894 to your computer and use it in GitHub Desktop.
JS Utils - Strips html tags from html code
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
// This functions strips html tags from html string | |
function strip(html) { | |
var tmp = document.createElement("DIV"); | |
tmp.innerHTML = html; | |
return tmp.textContent || tmp.innerText || ""; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment