Increase ID number as a button is clicked in js
<p>I have a button each time it is clicked, a new select input will be added. But I want the id and name of the select changed as well.My codes was:</p>

<pre><code>&lt;section&gt;
  &lt;div class="container"&gt;
   &lt;select id="myId_1" name="myName_1"&gt;
     &lt;option value="1"&gt;1&lt;/option&gt;
     &lt;option value="2"&gt;2&lt;/option&gt;
   &lt;/select&gt;
  &lt;/div&gt;
&lt;/section&gt;
&lt;button type="button" id="myBtn"&gt;add&lt;/button&gt;

$(document).ready(function () {
    $('#myBtn').click(function(){
      var addEvent = $('.container').html();
      var addEventCell = $('&lt;div class="container"&gt;'+addEvent+'&lt;/div&gt;');
      $('section').append(addEventCell);
    });
  });
</code></pre>

<p>But my code just duplicates the id and name of select. I want it to change to myId_2, myName_2,myId_3,myName_3 and so on.</p>

<p>I am new to javascript. It could be easy to you guys. Thanks for help !</p>
