2024年2月21日发(作者:)

jquery的数据增删改查(全选,反选,全不选,批量删除,添效果图如下:html代码如下:加信息)

//弹窗消失 $(".obox").hide()

$(".add").css({ "background":"#ccc" }) //点击del 删除本条数据 $(".toDel").on("click",function(){ $(this).parent().parent().remove()

})

})

//点击全选 全部选中

$(".seleAll").on('click',function(){

var seleAll=$("input[type='checkbox']") (function(){ ('checked',true)

})

}) // 反选 $(".reverse").on("click",function(){ var seleAll=$("input[type='checkbox']")

(function(){ d=!d

})

})

//全不选 $(".noneSele").on("click",function(){ var seleAll=$("input[type='checkbox']")

(function(){ ('checked',false)

}) }) //批量删除

$(".allDel").on("click",function(){

var allDel=$(":checkbox:checked") if (>0) { (function(){ $(this).parent().parent().remove()

})

} else{ alert('请选中数据后在删除')

}

})