Created
April 15, 2016 09:47
-
-
Save lonfee88/8f0bc12c2af1c927d05192ce9cb49a95 to your computer and use it in GitHub Desktop.
dom2html
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
function nodeToString ( node ) { | |
var tmpNode = document.createElement( "div" ); | |
tmpNode.appendChild( node.cloneNode( true ) ); | |
var str = tmpNode.innerHTML; | |
tmpNode = node = null; // prevent memory leaks in IE | |
return str; | |
} | |
//http://stackoverflow.com/questions/4239587/create-string-from-htmldivelement |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment