Created
July 19, 2015 20:43
-
-
Save GoesToEleven/d3bdbb5b5e563fc9cf93 to your computer and use it in GitHub Desktop.
javascript innerHTML vs textContent
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
nodeValue is a little more confusing to use, but faster than innerHTML. | |
innerHTML parses content as HTML and takes longer. | |
textContent uses straight text, does not parse HTML, and is faster. | |
innerText is IE specific and also takes styles into consideration. It won't get hidden text for instance. | |
http://stackoverflow.com/questions/21311299/nodevalue-vs-innerhtml-and-textcontent-how-to-choose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment