操作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;
}