title: Auto increment numbers in div id javascript
body: <p>can somebody please help me?
  How to add auto increment number in div ID using javascript?
  I have four divs and I'd like to have them automatically numbered (box1, box2, box3, box4) in the ID by javascript.</p>
  
  <p>Here's my code</p>
  
  <pre><code>&lt;div id="box" class="something"&gt; &lt;/div&gt;
  &lt;div id="box" class="something"&gt; &lt;/div&gt;
  &lt;div id="box" class="something"&gt; &lt;/div&gt;
  &lt;div id="box" class="something"&gt; &lt;/div&gt;
  
  &lt;script&gt;
    var list = document.getElementsByClassName("something");
    for (var i = 0; i &lt;= list.length; i++) {
     list[i].innerHTML = i;
    }
  &lt;/script&gt;
  </code></pre>