Operate the checkbox, select all and invert the selection
//Select all
function checkAll() {
$('input[name="TheID"]').attr("checked", "checked");
}
//Inverse selection
function uncheckAll( ) {
$('input[name="TheID"]').each(function() {
this.checked = !this.checked;
})
}
/ /Get the selected item
function getCheck(){
var check = $('input[name="TheID"]:checkbox').map(function() {
return $(this). val();
}).get().join(',');
return check;
}