вам нужно будет использовать другой метод для доступа к вашему элементу, так как вы можете ссылаться только на отдельные элементы по идентификатору. вариант будет ссылаться на них по классу, или, если это будет мой выбор, использовать jQuery, и он встроен в селектор ..
var myHTML='...whatever'; // this is the HTML we built somewhere
var myDIV=$('<div/>'); // here we create a DOM object in jQuery
$(myDiv).addClass('myClass'); // here we add a class so we can find them later
$(myDiv).append(myHTML); // here we insert the HTML we built earlier and referenced up top
for(x=1;x<=4,x++){ // here we loop
$('#someDistinceElementOnPage').append($(myDiv)); // here we append that HTML with it's surrounding DIV to some element on the page
}