JSFiddle - React, Tailwind, and code Playground

by Joe

HTML

<table>
  <tr>
    <td class="addinput">
      <input type="text" id="p_new" name="data[]" value="1"><a href="#" class="addNew">Add New</a>
    </td>
  </tr>
</table>

CSS

a {
  text-decoration: none !important;
}

JavaScript

$(document).ready(function() {

   $('.addNew').on('click', function() {
     var row = $(this).closest('table').find('tr:last-child').clone();
     $(this).closest('table').append(row);
     });

 });