Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

unable to append div multiple times

window.onload = function(){
var el = document.createElement('div');
el.appendChild(document.createTextNode('Hi'));
for (var i = 10; i > 0; --i)
document.body.appendChild(el.cloneNode(true)); // cloning is important
};
//http://www.dynamicdrive.com/forums/showthread.php?38076-Can-you-append-the-same-node-multiple-times
Source by www.dynamicdrive.com #
 
PREVIOUS NEXT
Tagged: #unable #append #div #multiple #times
ADD COMMENT
Topic
Name
7+7 =