JSFiddle - React, Tailwind, and code Playground
HTML
<table id="Newservice" style="display:none">
<tr>
<td><input id="start-%" class="datepicker" style="width:75px" type="text" name="provider_service_dtls[#].activity_start_date" value /></td>
<td><input id="type-%" style="width:100px" class="act_type" type="text" name="provider_service_dtls[#].activity_type" readonly value /></td>
<td><input id="code-%" class="act_code" style="width:150px" type="text" name="provider_service_dtls[#].activity_code" value /></td>
<td><input id="clinician-%" class="clini" style="width:150px" type="text" name="provider_service_dtls[#].clinician" value /></td>
<td><input id="net-%" class="" style="width:40px" type="text" name="provider_service_dtls[#].net_amt" value /></td>
<td><input id="qty-%" class="" style="width:25px" type="text" name="provider_service_dtls[#].quantity" value />
<input type="hidden" name="provider_service_dtls.Index" value="%" />
</td>
<td><input id="delete" class="delete" value="X" type="button"></td> </tr>
</table>
<input type='button' id='btnAdd' value='Add'/>
<table id='dvTable'>
</table>
<input type='button' id='btnSubmit' value='Submit'/>
JavaScript
$("#btnAdd").click(function() {
addTable();
});
$("#btnSubmit").click(function() {
var table = $("#dvTable");
table.find('tr').each(function(i, el){
$(this).find('td').each(function(j,elem){
alert($(this).find('input').val());
//alert($(this).html());
});
});
});
var addTable = function () {
var index = (new Date()).getTime();
var clone = $('#Newservice').clone();
clone.html($(clone).html().replace(/\[#\]/g, '[' + index + ']'));
clone.html($(clone).html().replace(/"%"/g, '"' + index + '"'));
clone.html($(clone).html().replace(/"token-input-diag-%"/g, 'token-input-diag-' + index));
clone.html($(clone).html().replace(/"token-input-desc-%"/g, 'token-input-desc-' + index));
clone.html($(clone).html().replace(/"type-%"/g, 'type-' + index));
clone.html($(clone).html().replace(/"code-%"/g, 'code-' + index));
clone.html($(clone).html().replace(/"start-%"/g, 'start-' + index));
clone.html($(clone).html().replace(/"clinician-%"/g, 'clinician-' + index));
clone.html($(clone).html().replace(/"net-%"/g, 'net-' + index));
clone.html($(clone).html().replace(/"qty-%"/g, 'qty-' + index));
var html = clone.html();
$("#dvTable").append(html);
}