Javascript performance createDocumentFragment vs createElement / innerHTML

Oscar Brito

Using DocumentFragments is faster than repeated single DOM node injection and allows developers to perform DOM node operations (like adding events) on new elements instead of mass-injection via innerHTML.  

var frag = document.createDocumentFragment();

Instead of:

var li = document.createElement("li");

out of dom vs documentfragment ยท jsPerf:

Visit for more informations, contacts and news about Web Development.
See other blog posts at

Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.

Feel free to contact divhide.