title: For loop and get Element?
body: <p>I have a for loop like :</p>
  
  <pre><code>for(i=0; i&lt;6; i++)
  {
  if(i=0)
  {a1 = '&lt;div&gt;something1&lt;/div&gt;';}
  if(i&gt;=1 &amp; i&lt;=5)
  {b1 = '&lt;div&gt;something2&lt;/div&gt;';}
  }
  document.getElementById('example').innerHTML = a1 + b1;
  
  &lt;div id='example'&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Result just have : <code>&lt;div&gt;something1&lt;/div&gt;&lt;div&gt;something2&lt;/div&gt;</code></p>
  
  <p>I want result : </p>
  
  <pre><code>&lt;div&gt;something1&lt;/div&gt;
  &lt;div&gt;something2&lt;/div&gt;
  &lt;div&gt;something2&lt;/div&gt;
  &lt;div&gt;something2&lt;/div&gt;
  &lt;div&gt;something2&lt;/div&gt;
  &lt;div&gt;something2&lt;/div&gt;
  </code></pre>
  
  <p>How can I do this with <code>for loop</code> above. Thanks for your help.</p>