My Fiddle如何删除未选中的复选框的父元素在jQuery的
我需要删除未选中的复选框的项目。我不知道我要去哪里错。有些项目只能删除,我不知道为什么?
$(document).ready(function(){
$('#remove').click(function(){
var classlength = $('.showdropdowninv').find('.classname').length;
for(var i=0;i< classlength; i++){
if($('.showdropdowninv').find(".classname").eq(i).attr('checked') == true){
} else {
$('.showdropdowninv').find(".classname").eq(i).closest('li').remove();
} //else close
}
});
});
只需检查一些复选框,然后单击删除链接。
我需要删除它的不选中的checkobx我该怎么做? –
这听起来像你试图删除被检查的项目,这是否 – depperm
我编辑我的问题请检查它@depperm –