Javascript for loop - help
<p>I'm trying to create the following html dynamically with js, but couldn't quite make the loop works.
I'll be getting the count value (i.e: 1, 2, 3, etc.) from a user input.</p>

<pre><code>&lt;div class='outer-1'&gt;
    &lt;div class='inner-1'&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class='outer-2'&gt;
    &lt;div class='inner-1'&gt;&lt;/div&gt;
    &lt;div class='inner-2'&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class='outer-3'&gt;
    &lt;div class='inner-1'&gt;&lt;/div&gt;
    &lt;div class='inner-2'&gt;&lt;/div&gt;
    &lt;div class='inner-3'&gt;&lt;/div&gt;
&lt;/div&gt;
........
</code></pre>

<p>This is what I've so far:</p>

<pre><code>var html = '';
for (var i = 1; i &lt;= count; i++) {
    html += "&lt;div class='outer-"+ i +"'&gt;";
    html += "&lt;div class='inner"-"+ i +"'&gt;&lt;/div&gt;";
    html += "&lt;/div&gt;";
}
</code></pre>

<p>That code only prints like below. </p>

<pre><code>&lt;div class='outer-1'&gt;
    &lt;div class='inner-1'&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class='outer-2'&gt;
    &lt;div class='inner-2'&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Please help!</p>
