Jquery代码
$(document).ready(function () {
//全选操作
$("#btnSelectAll").click(function () {
$(".parent input:checkbox").attr("checked", $(this).attr("checked"))
});
//批量删除
$("#btnDel").click(function () {
var count = $(".parent input:checkbox:checked").length;
if (count > 0) {
var isDel = confirm("你确定要批量删除吗?");
if (isDel) {
var list = "";
$(".parent input:checkbox:checked").each(function () {
list += $(this).val() + ',';
});
window.location.href = "?action=del&id=" + list;
}
} else {
alert("你没有选择任何一个");
}
});
});