Skip to content

Instantly share code, notes, and snippets.

@DKunin
Created June 15, 2013 18:02
Show Gist options
  • Save DKunin/5788991 to your computer and use it in GitHub Desktop.
Save DKunin/5788991 to your computer and use it in GitHub Desktop.
doc fragment
var somewhere = document.getElementById('here'),
fragment = document.createDocumentFragment(),
i, li;
for(i = 0; i < 1000; i++){
li = document.createElement('li');
li.innerText = i;
fragment.appendChild(li);
}
somewhere.appendChild(fragment);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment