<
button
class
=
"btn btn_big"
type
=
"button"
onClick
=
"chkall(0)"
>反选</
button
>
<
button
class
=
"btn btn_big"
type
=
"button"
onClick
=
"chkall(1)"
>全选</
button
>
<
button
class
=
"btn btn_big"
type
=
"button"
onClick
=
"chkall(2)"
>全不选</
button
>
function chkall(v){
var ck=document.getElementsByName("xuanze_fz");//定义checkbox数组变量
for(var i=0;i<ck.length;i++){
if (!ck[i].disabled){//被禁用的不执行操作选择,跳过
if (v==0){
ck[i].checked=!ck[i].checked;
}else if (v==1){
ck[i].checked='checked';
}else if (v==2){
ck[i].checked='';
}
}
}
}