I have a loop forto generate string divs, my code
for(j=0; j<7; j++) {
$('<div/>', {
id: 'unique',
html: 'whatever'
}).appendTo('#container');
This code seems to be looking for #container for each iteration and adding a new div to it.
How to write code so that I can first create all the divs and then add everything to the container all at once? Sorry, I tried to find keywords like concatenate / group / add jquery objects and it doesn't seem to have the correct search results.
TIA
source
share