jquery、js操作checkbox全選択逆選択


操作checkbox、全選択逆
 
//
function checkAll() {
$('input[name="TheID"]').attr("checked", "checked");
}
//
function uncheckAll() {
$('input[name="TheID"]').each(function() {
this.checked = !this.checked;
})
}
//
function getCheck(){
var check = $('input[name="TheID"]:checkbox').map(function() {
return $(this).val();
}).get().join(',');
return check;
}