The following is my code
$(document).ready(function(){
$(\'#click\').click(function(){
$(\'#table\').append(\'&a
-
A demo is at http://jsfiddle.net/BfKSa/ or in case you are binding, add and delete to every row, this different demo http://jsfiddle.net/xuM4N/ come in handy.
API: remove => http://api.jquery.com/remove/
As you mentioned: This will delete the "delete the last row of the table"
$('#table tr:last').remove();
will do the trick for your case.
Code
$(document).ready(function(){
$('#click').click(function(){
$('#table').append('foo add ');
})
$('#remove').click(function(){
$('#table tr:last').remove();
})
})
- 热议问题