Created
March 14, 2016 08:13
-
-
Save kennethhutw/1ef3beb182c722203178 to your computer and use it in GitHub Desktop.
converts HTML to text using Javascript
This file contains 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
// converts HTML to text using Javascript | |
function html2text(html) { | |
var tag = document.createElement('div'); | |
tag.innerHTML = html; | |
return tag.innerText; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment