I need to add multiple empty divs to a container element using jQuery.
At the moment I am generating a string containing the empty html using a loop
divstr = '<div></div><div></div>...<div></div>';
and then injecting that into my container:
$('#container').html(divstr);
Is there a more elegant way to insert multiple, identical elements?
Edit: I'm hoping to find something that wouldn't break chaining but wouldn't bring the browser to its knees. A chainable .repeat() plugin?