I have a script that clones the last table row and inserts it at the bottom of my table by clicking a [+] icon. What I'd like to do is allow the removal of the last table row by clicking an [-] icon. Is this possible and if so, could someone point me in the right direction?
<script type="text/javascript">
$(document).ready(function() {
$("#add").click(function() {
$('#mytable tbody>tr:last').clone(true).insertAfter('#mytable tbody>tr:last');
$('#mytable tbody>tr:last #itemid').val('');
$('#mytable tbody>tr:last #itemdesc').val('');
return false;
});
});
</script>