Revision: 44492
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 12, 2011 22:12 by root_hacker
Initial Code
function repeat(str,n) { return new Array(n+1).join(str); } repeat("<li class='empty'>" , 2); //output: "<li class='empty'><li class='empty'>"
Initial URL
Initial Description
when need to created a dom element repeatedly , use string concatenation to avoid for loop you can use repeat function from below.
Initial Title
javascript: create DOM element without using for loop
Initial Tags
javascript, best
Initial Language
JavaScript