JSFiddle - React, Tailwind, and code Playground
HTML
<form action="#" method="post">
<input type="button" id="newItem" value="Add Row">
<table id="items">
<tr>
<th>Item</th>
<td>
<input type="text" name="field0">
</td>
</tr>
</table>
</form>
JavaScript
var inc = 0;
$('#newItem').click(function() {
inc++;
var $input = $('#items input').attr('name', 'field' + inc);
console.log( $input[0].name, $input.attr('name') );
});