Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
JS createDocumentFragment to avoid reflow
var list = document.getElementsByClassName('items')[0],
fragment = document.createDocumentFragment(),
i, item;
for (i=0; i < 10; i++) {
item = document.createElement('li');
item.innerHTML = 'item #'+i;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment