<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body>苹果:
<input type="checkbox" name="id" value="aa">香蕉:
<input type="checkbox" name="id" value="bb">橘子:
<input type="checkbox" name="id" value="cc">
<button id="btn">批量删除</button>
</body>
<script>
$('#btn').click(function () {
var id=[];
$("input[name='id']:checked").each(function(){
id.push($(this).val());
});
console.log(id);
});
</script>
</html>
运行效果