Web Programming: Fastest way for appending DOM elements

PHOTO EMBED

Mon Aug 29 2022 20:07:17 GMT+0000 (UTC)

Saved by @marcopinero #javascript #html

var c = document.createDocumentFragment();
for (var i=0; i<10000; i++) {
    var e = document.createElement("div");
    e.className = "test-div";
    c.appendChild(e);
}
document.body.appendChild(c);
content_copyCOPY