100 element innerHTML | var innerHTMLstr = '<div>';
for (var i = 0; i < 100; i++) {
innerHTMLstr += '<div><span>' + i + '</span></div>';
}
innerHTMLstr+='</div>';
document.getElementById('container').innerHTML = innerHTMLstr;
| ready |
100 element createElement added in sequence | var container = document.getElementById('container');
var outerdiv = document.createElement('div');
container.appendChild(outerdiv);
for (var i = 0; i < 100; i++) {
var div = document.createElement('div');
var span = document.createElement('span');
span.innerHTML = i;
div.appendChild(span);
outerdiv.appendChild(div);
}
| ready |
100 element createElement bulk add | var container = document.getElementById('container');
var outerdiv = document.createElement('div');
for (var i = 0; i < 100; i++) {
var div = document.createElement('div');
var span = document.createElement('span');
span.innerHTML = i;
div.appendChild(span);
outerdiv.appendChild(div);
}
container.appendChild(outerdiv);
| ready |
100 element deep cloneNode bulk add | var container = document.getElementById('container');
var outerdiv = document.createElement('div');
var protodiv = document.createElement('div');
var protospan = document.createElement('span');
protodiv.appendChild(protospan);
for (var i = 0; i < 100; i++) {
var div = protodiv.cloneNode(true);
div.childNodes[0].innerHTML = i;
outerdiv.appendChild(div);
}
container.appendChild(outerdiv);
| ready |
100 element shallow cloneNode bulk add | var container = document.getElementById('container');
var outerdiv = document.createElement('div');
var protodiv = document.createElement('div');
var protospan = document.createElement('span');
protodiv.appendChild(protospan);
for (var i = 0; i < 100; i++) {
var div = protodiv.cloneNode();
var span = protospan.cloneNode();
span.innerHTML = i;
div.appendChild(span);
outerdiv.appendChild(div);
}
container.appendChild(outerdiv);
| ready |