Finally found a way to a new table-row with jQuery but I don't know how I can remove the same table-row with a button click.
I have tried using this code but nothing happens.
$(document).ready(function() {
$("#btnAdd").click(function() {
$("table").append(
"<tr id='tr2'><td class='col-md-8'><input type='list' class='form-control'></input></td><td><button type='button' class='btn btn-info btn-rounded btn-sm my-0'>Omhoog</button></td><td><button type='button' class='btn btn-info btn-rounded btn-sm my-0'>Omlaag</button></td><button></button><td><button id='btnRemove2' type='button' class='btn btn-danger btn-rounded btn-sm my-0'>Verwijder</button></td></tr>"
);
});
$("#btnRemove").click(function() {
$("#tr1").remove();
});
$("#btnRemove2").click(function() {
$("#tr2").remove();
});
});
I wish to remove tr2
when clicking the button with id='btnRemove2'
but when I click remove button nothing happens.