title: How to Clone Row With Value
body: <p>I want to clone row with same value according last row that i have filled. Here is screenshot my app.</p>
  
  <ol>
  <li><a href="https://drive.google.com/open?id=0B9_Xi3waidNLUE0zaHlONHNWcjQ" rel="nofollow noreferrer">https://drive.google.com/open?id=0B9_Xi3waidNLUE0zaHlONHNWcjQ</a></li>
  <li>My expected result <a href="https://drive.google.com/open?id=0B9_Xi3waidNLYnVnVFlhSUx4WWM" rel="nofollow noreferrer">https://drive.google.com/open?id=0B9_Xi3waidNLYnVnVFlhSUx4WWM</a></li>
  </ol>
  
  <p>Here is My Code :</p>
  
  <pre><code>function addTableRowHasilProduksi() {
  row = parseInt($('#tableRowHasilProduksi').val()) + 1;
  $('#plusButtonHasilProduksi').remove();
  var html = ' \
  &lt;tr id="rowTableHasilProduksi_' + row + '"&gt; \
    &lt;td&gt; \
     &lt;select id="typepartid_' + row + '" class="form-control" onchange="myFunction(' + row + ')" name="typepartid_' + row + '"&gt; \
     ' + htmlPartId + ' \
    &lt;/td&gt; \
   &lt;td&gt;\
      &lt;select id="hasilproduksi_' + row + '" class="form-control" placeholder="select" onchange="hasilProduksiChage(' + row + ')" name="hasilproduksi_' + row + '"&gt; \
        &lt;option value="-"&gt;--Select--&lt;/option&gt;\
        &lt;option value="Good"&gt;Good&lt;/option&gt;\
        &lt;option value="Repair"&gt;Repair&lt;/option&gt;\
        &lt;option value="Reject"&gt;Reject&lt;/option&gt;\
      &lt;/select&gt; \
    &lt;/td&gt; \
    &lt;td&gt;&lt;input id="qty_' + row + '" type="text" class="form-control"  onkeydown="return numbersonly(this, event);" onkeyup="javascript:tandaPemisahTitik(this);" name="qty_' + row + '" /&gt; \
    &lt;/td&gt; \
     &lt;td&gt;&lt;input id="waktu_' + row + '" type="text" class="form-control" name="waktu_' + row + '" onfocusout="waktuOnFocusOut(this)" onfocusin="waktuOnFocusIn(this)"/&gt;&lt;/td&gt; \
    &lt;td id="tdTypeReject_' + row + '"&gt; \
      &lt;select id="typereject_' + row + '" class="form-control" name="typereject_' + row + '"&gt; \
      ' + htmlTypeReject + ' \
      &lt;/select&gt; \
    &lt;/td&gt; \
    &lt;td&gt;&lt;input id="keteranganreject_' + row + '" type="text" class="form-control" name="keteranganreject_' + row + '"/&gt;&lt;/td&gt; \
    &lt;td&gt;&lt;button type="button" class="btn btn-sm btn-default" onclick="deleteRowHasilProduksi(' + row + ')"&gt;x&lt;/button&gt;&lt;/td&gt; \
  &lt;/tr&gt; \
  &lt;tr id="plusButtonHasilProduksi"&gt; \
    &lt;td colspan="7"&gt;&lt;button type="button" class="btn btn-sm btn-default" style="width:100%" onclick="addTableRowHasilProduksi()"&gt;+&lt;/button&gt;&lt;/td&gt; \
  &lt;/tr&gt;';
  $('#tableHasilProduksi &gt; tbody').append(html);
  //variable row table add +1
  $('#tableRowHasilProduksi').val(row);
  $('#plusButtonHasilProduksi').attr('onclick', 'addTableRowDowntime()');}
  </code></pre>
  
  <p>Any Help can be appreciated.</p>