title: How to increment div id value?
body: <p>I have got a task to set the menu as selected. For that I use dynamic id.
  So I want to increment it with respect to the selection</p>
  
  <p>My code is</p>
  
  <pre><code>&lt;div class="menuHeader ui-corner-top" id="menu"+ i&gt;
      &lt;span&gt;&lt;a href="#" onclick="Home()"&gt;Home&lt;/a&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class="menuHeader ui-corner-top" id="menu"+ i&gt;
      &lt;span&gt;&lt;a href="#" onclick="NewTransaction()"&gt;New Transaction&lt;/a&gt;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class="menuHeader ui-corner-top" id="menu"+ i&gt;
      &lt;span&gt;&lt;a href="#" onclick="Portfolio()"&gt;Portfolio&lt;/a&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>javascript is</p>
  
  <pre><code>$(document).ready(function () {
               alert(document.URL);
               var list = $("#menu");
               for (var i = 1; i &lt;= list.length; i++) {
                   list[i].innerHTML = i;
               }
               var str = document.URL.toLowerCase().indexOf("portfolio/index");
               alert(str);
               if (str &gt;= 0) {
                   $('#menu').addClass("menuHeaderActive");
               }
           });
  </code></pre>
  
  <p>How can I do this?</p>