Creating a loop that populates a select tag
<pre><code>function buildOrder(data) {
    var $fragment;
    $fragment = $('&lt;div/&gt;');
    for (var i = 0; i &lt; data.length; i++) {
        $fragment.append('&lt;div class="row-container"&gt;&lt;div class="row cupcake-row"&gt;' + data[i].name + '&lt;/div&gt;&lt;div class="clear"&gt;&lt;/div&gt;&lt;/div&gt;');
    }
    $('#review-section').append($fragment);
}
</code></pre>

<p>I essentially want to add a  tag with 50 options being dynamically created using a for loop. But I'm not sure what the syntax would be to add it to the <code>&lt;div class="row-container"/&gt;</code>  I know in php I would just throw the loop in the middle and echo the options, however that doesnt work in javascript.</p>

<p>EDIT:</p>

<p>It would look like this:</p>

<pre><code>$fragment.append('&lt;div class="row-container"&gt;&lt;div class="row cupcake-row"&gt;' + data[i].name + '&lt;/div&gt;&lt;select&gt;&lt;option value="1"&gt;1&lt;/option&gt; etc...&lt;/select&gt;&lt;div class="clear"&gt;&lt;/div&gt;&lt;/div&gt;');
</code></pre>
