<a id="btnDelete" class="btn btn-danger btn-sm" href="#" οnclick="del_item();"><i></i><span>删除</span> </a>
<script>
function del_item() {
//var url="ajaxContentConfirm('/jf/platform/dic/deleteD/${escapeXml(d.ids!)}');";//删除的方法/及路径
$.each($('input[type="checkbox"]'), function(index, row) { //$('input[type="checkbox"]'=$(":checkbox")
if ($(row).prop('checked'))//prop
{
var data_ids = $(row).attr('data-ids');
//alert(data_ids);
ajaxContentConfirm('/jf/platform/dic/deleteD/'+ data_ids);
}else{
alert("请选择!");
}
})
}
$("#btnSec").click(function() {//全选
if ($("input[type='checkbox']").prop("checked")) {
$("input[type='checkbox']").each(function() {
$(this).prop("checked", false);
$("#sec").html("全选");
});
} else {
$("input[type='checkbox']").each(function() {
$(this).prop("checked", true);
$("#sec").html("取消");
});
}
});
</script>
<td align="center"><span style="vertical-align: middle;">
<input type="checkbox" data-ids="${escapeXml(d.ids!)}" /> </span></td>//data-ids自定义属性