Skip to content

Instantly share code, notes, and snippets.

@ymkjp
Created November 20, 2012 03:51
Show Gist options
  • Save ymkjp/4115836 to your computer and use it in GitHub Desktop.
Save ymkjp/4115836 to your computer and use it in GitHub Desktop.
Performance of DOM
var fragment = document.createDocumentFragment();
for (var i = 0; i < 10; i++) {
var child = document.createElement('div');
// here
fragment.appendChild(child);
}
document.getElementById('parent').appendChild(fragment);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment