<p>I need to add multiple empty divs to a container element using jQuery.</p>

<p>At the moment I am generating a string containing the empty html using a loop</p>

<pre><code>divstr = '&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;...&lt;div&gt;&lt;/div&gt;';
</code></pre>

<p>and then injecting that into my container:</p>

<pre><code>$('#container').html(divstr);
</code></pre>

<p>Is there a more elegant way to insert multiple, identical elements?</p>

<p>I'm hoping to find something that wouldn't break chaining but wouldn't bring the browser to its knees. A chainable <code>.repeat()</code> plugin?</p>

You can use a regular loop with the Jquery
append
function.
```
```
for(i=0;i<10; i++){
    $('#container').append("<div></div>");
}
```
```