Created
July 30, 2013 08:43
-
-
Save EragonJ/6111312 to your computer and use it in GitHub Desktop.
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
var div = document.getElementsByTagName("div"); | |
for ( var i = 0; i < div.length; i++ ) { | |
for ( var e = 0; e < elems.length; e++ ) { | |
div[i].appendChild( elems[e].cloneNode(true) ); | |
} | |
} |
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
var div = document.getElementsByTagName("div"); | |
var fragment = document.createDocumentFragment(); | |
for ( var e = 0; e < elems.length; e++ ) { | |
fragment.appendChild( elems[e] ); | |
} | |
for ( var i = 0; i < div.length; i++ ) { | |
div[i].appendChild( fragment.cloneNode(true) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment