Creating multiple divs using jquery
<p>I need to create multiple divs like below based on how many objects are in my collection</p>

<pre><code>  &lt;div class="container"&gt;
    &lt;a href="#"&gt;title test&lt;/a&gt;
    &lt;div class="video"&gt;
    video test
    &lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>I want to use jquery to acheive this.</p>

<pre><code>for(i =0 ;i &lt; list.size; i++){

$("#wrapper").append(createDiv(list[i]));

}

function createDiv(object){

 return &lt;div class="container"&gt;
    &lt;a href="object.link"&gt;object.title&lt;/a&gt;
    &lt;div class="video"&gt;
    object.video
    &lt;/div&gt;
    &lt;/div&gt;;
}
</code></pre>

<p>I feel this way to too hard coded as I may need to reconstruct the <code>container</code> class. For example I may want to put in another div tag or more links. I'm wondering if there is an alternative way to do this that would allow flexibility in my code. Instead of <code>createDiv</code> return one large string, should I be using query functions such as <code>createElement</code>? </p>

<p>Thanks for any advice :)</p>
