1. 全选或全部取消
//全选或全部取消 function checkAll(){ $("input[name='xxx']").attr("checked",$("#checkAll").attr("checked")==undefined?false:true); }
?2. 获取被选中项的值存放于数组中
var allChecked = $("input[name='xxx']:checked");var ids = [];//循环拼装被选中项的值allChecked .each(function(i){ ids.push($(this).val());});
?3. 获取未被选中项的值存放于数组中?
var notChecked = $("input[name='xxx']").not("input:checked");var ids = [];//循环拼装未被选中项的值notChecked.each(function(i){ removeIds.push($(this).val());});
?