admin管理员组文章数量:1356536
I have a table which is dynamically created , there is a checkbox in each row of the table, when user click that checkbox the whole row of the dynamically created table needs to deleted.
I have a table which is dynamically created , there is a checkbox in each row of the table, when user click that checkbox the whole row of the dynamically created table needs to deleted.
Share Improve this question edited Jan 4, 2011 at 22:27 Pinu asked Jan 4, 2011 at 19:55 PinuPinu 7,53016 gold badges55 silver badges77 bronze badges 1- 1 Can give a more accurate answer if you include a snippet of the HTML for the table/checkbox. – JohnFx Commented Jan 4, 2011 at 19:56
5 Answers
Reset to default 7$("tr input:checkbox").live("click", function(){
$(this).closest("tr").remove();
});
$(function(){
$(".yourCheckboxClass").change(event){
function(){
$(this).closest('tr').remove();
}
}
});
$('table').delegate('tr input:checkbox', 'click', function () {
$(this).closest('tr').remove();
});
Demo here
You can apply this specific table, like this.
$("#yourtableID tr").live("click", function(){
$(this).closest("tr").remove();
});
$('table.grid input:checkbox').change(function(){
$(this).parents('tr').remove();
});
本文标签: javascriptjquery delete table row on click on check boxStack Overflow
版权声明:本文标题:javascript - jquery delete table row on click on check box - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744026160a2578076.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论