<input type=checkbox>
<input type=checkbox>
<input type=checkbox>
<input type=checkbox>
<input type=checkbox>
<p><input type=button value=select onclick="for(var i=0;i<document.all.length;i++){if(document.all(i).type=='checkbox')document.all(i).checked =true;}">
<input type=checkbox>
<input type=checkbox>
<input type=checkbox>
<input type=checkbox>
<p><input type=button value=select onclick="for(var i=0;i<document.all.length;i++){if(document.all(i).type=='checkbox')document.all(i).checked =true;}">
function ok()
{
o = document.getElemnentsByTagName("INPUT")
for(i=0;i<o.length;i++)
{
if(o[i].type=='checkbox') o[i].checked=ischeked
}
ischeked=!ischeked
}
function JyDown() {
for (var i=0;i<document.JyDownH.JyDownID.length;i++) {
var e=document.JyDownH.JyDownID[i];
e.checked=!e.checked;
}
}
</script><a href="javascript:JyDown()">选择</a>JyDownID[i]为多选框各框的id值当你点击选择时就能实现
{ for(i=0;i<document.forms.length;i++)
{
for(j=0;j<document.forms[i].elements.length;++j)
{if(document.forms[i].elements[j].disabled==false)
if(document.forms[i].elements[j].type=="checkbox")
{
if(exclude)
{
for(m=0;m<exclude.length;m++)
{
if(document.forms[i].elements[j].name!=exclude[m])
document.forms[i].elements[j].checked=true;
}
}
else
document.forms[i].elements[j].checked=true; }
}
}
}
<head>
<script language="vbscript">
sub button1_onclick
for each i in form1
i.checked=not i.checked
next
end sub
</script>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<form name="form1">
<input type="checkbox" >
<input type="checkbox" >
<input type="checkbox" >
<input type="button" name="button1" value="click">
</form>
</body>
</html>
<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.getElementsByTagName("INPUT");
for (var i=0;i<inputs.length;i++){
if (inputs[i].type=="checkbox" && all==true){
inputs[i].checked=true;
//inputs[i].style.background=""
}else{
inputs[i].checked=false;
//inputs[i].style.background=""
}
}
}
function woyingjie(){
var n=0;
for (i=0;i<document.all.m.length;i++) {
document.all.m[i].checked==true?n++:'';
}
document.all.all.checked=n==6;
}
</script>
<!--
function chkAll(){
var iIndex=0;
for(iIndex=0;iIndex<form1.length;iIndex++){
if(form1.elements[iIndex].name=="checkbox"){
form1.elements[iIndex].checked;
}
}
}
//-->
</script><input type="button" name="button1" onClick="chkAll();">