title: How to pass form elements to array using their id's
body: <p>I have created objects, and then I need to store those data into array.</p>
  
  <p>Using this function I create Items. Each and every Items I need to save into array.</p>
  
  <pre><code>function appendItemforPurchaseOrder() {
      debugger
  
      var rowNumber = parseInt($(".itemmapContainer").attr("data-rownumber"));
  
      rowNumber = isNaN(rowNumber) ? 1 : rowNumber + 1;
  
      var addNewItemDetailHtml = "&lt;div class='col-lg-12 col-md-12 col-sm-12 col-xs-12 itemmapWrapper custom-paaddingnone'\
                                 id='itemmapWrapper" + rowNumber + "' data-rowNumber='" + rowNumber + "' &gt;";
  
      addNewItemDetailHtml += "&lt;div class='col-lg-10 col-md-10 col-sm-10 col-xs-10 custom-paaddingnone form-group'&gt;\
                                      &lt;div class='col-lg-1 col-md-1 col-sm-1 col-xs-1 itemclass custom-paaddingnone text-center'&gt;" + rowNumber + "\
                                      &lt;/div&gt;\
                                      &lt;div class='col-lg-11 col-md-11 col-sm-11 col-xs-11 custom-paaddingnone'&gt;\
                                          &lt;div class='col-lg-12 col-md-12 col-sm-12 col-xs-12 custom-paaddingnone form-group'&gt;\
                                              &lt;div class='col-lg-3 col-md-3 col-sm-3 col-xs-3 custom-paaddingleft' onChange='getItemCode(" + rowNumber + ")'&gt;\
                                                  &lt;select class='form-control' id = 'itemid"+ rowNumber + "' &gt;&lt;/select&gt;\
                                              &lt;/div &gt;\
                                          &lt;/div&gt;\
                                      &lt;/div&gt;\
                                  &lt;/div &gt;";
  
      addNewItemDetailHtml += "&lt;div class='col-lg-2 col-md-2 col-sm-2 col-xs-2 form-group'&gt;\
                                   &lt;div class='col-lg-10 col-md-10 col-sm-10 col-xs-10'&gt;\
                                          &lt;input type='text' class='form-control text-right' id='totalamount"+ rowNumber + "' disabled&gt;\
                                  &lt;/div&gt;\
                                  &lt;div class='col-lg-2 col-md-2 col-sm-2 col-xs-2'&gt;\
                                          &lt;span class='glyphicon glyphicon-trash removeBtn' onclick = 'removeItemDetail(this, " + rowNumber + ")' &gt;&lt;/span &gt;\
                                  &lt;/div&gt;\
                              &lt;/div &gt; ";
  
  
      addNewItemDetailHtml += "&lt;/div&gt;";
  
      addNewItemDetailHtml += "&lt;/div&gt;";
  
      $(".itemmapContainer").attr("data-rownumber", rowNumber);
      $(".itemmapContainer").append(addNewItemDetailHtml);
      intialize_itemDropDown(rowNumber);
      intialize_Data(rowNumber);
  }
  </code></pre>
  
  <p>There are some more other objects are available but if anyone can resolve this with these objects that would be great. </p>