<input name="all" type="checkbox"  onclick="baoall()"><font size="2">全选</font><br>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()>
<input name="m" type="checkbox" onclick=woyingjie()><script language="javascript">
function baoall(){
var all=document.all.all.checked;
var inputs=document.all.m;
for (var i=0;i<inputs.length;i++){
if (all==true){
inputs[i].checked=true;
inputs[i].style.background="black"
}else{
   inputs[i].checked=false;
inputs[i].style.background=""
   }
}
}
function woyingjie(){
var hoho=document.all.m
for (var i=0;i<hoho.length;i++){
if (!hoho[i].checked){
document.all.all.checked=false;
return false;
}
}
document.all.all.checked=true;
return true;
}
</script>