I have a code when the person clicks add the code generates other forms .. but how do I in each form have the option to delete? Note: I do not want to delete the last one added but a certain one.
var counter = 1;
jQuery('a.add-author').click(function(event){
event.preventDefault();
counter++;
var newRow = jQuery('<tr><td><input type="text" name="first_name' +
counter + '"/></td><td><input type="text" name="last_name' +
counter + '"/></td></tr>');
jQuery('table.authors-list').append(newRow);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.1/jquery.min.js"></script><tableclass="authors-list">
<tr><td>author's first name</td><td>author's last name</td></tr>
<tr><td><input type="text" name="first_name" /></td><td><input type="text" name="last_name" /></td></tr>
</table>
<a href="#" title="" class="add-author">Add Author</a>