//全选 、反选
<input id="Checkbox1" name='qx' type="checkbox" οnclick='CheckParend(this,"qx")' value="" />全部
function CheckParend(ch, ckname) {
if (ch.checked == true) {
$("input[name='" + ckname + "']").each(function () {
$("input[name='" + ckname + "']").prop("checked", true); //全部选中
});
}
else {
$("input[name='" + ckname + "']").each(function () {
$("input[name='" + ckname + "']").prop("checked", false); //全部不选中
});
}
}
//<input type='checkbox' name='id' value='11'/>
//全选
function
select_all(){
$(
"input[name='id']"
).attr(
"checked"
,
true
);
}
//全不选
function
unselect_all(){
$(
"input[name='id']"
).attr(
"checked"
,
false
);
}
//反向选择
function
select_other(){
jQuery.each($(
"input[name='id']"
),
function
(i, n){
n.checked = !n.checked;
});
}