< html >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=gbk" >
< script language ="javascript" >
function selectIt(action,frm,name){
var es= frm.elements[name];
if (es.length)
for(var i=0,e;e = es[i],i<es.length;i++)
e.checked=(action)?1:(!e.checked);
else
es.checked=(action)?1:(!es.checked);
}
</script>
</head>
< body >
< form name ="bdkey" id ="bdkey" >
< p class ="STYLE1" >
全 选
< input type ="checkbox" name ="selectAll" value ="checkbox" onClick ="selectIt(1,this.form,'checkbox')" > < br >
反 选
< input type ="checkbox" name ="invest" value ="checkbox" onClick ="selectIt(0,this.form,'checkbox')" > < br >
Item1
< input type ="checkbox" name ="checkbox" value ="checkbox" >
< br >
Item2
< input type ="checkbox" name ="checkbox" value ="checkbox" > < br >
Item3
< input type ="checkbox" name ="checkbox" value ="checkbox" > < br >
Item4
< input type ="checkbox" name ="checkbox" value ="checkbox" > < br >
Item5
< input type ="checkbox" name ="checkbox" value ="checkbox" >
</p>
</form>
</body>
转载于:https://blog.51cto.com/yardan/107366