<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
div{
widows: 100%;
height: 2px;
background: #888;
margin-top: 10px;
}
</style>
</head>
<body>
<input type="button" value="全选" οnclick="CheckAll()">
<input type="button" value="不选" οnclick="UnCheck()">
<input type="button" value="反选" οnclick="othercheck()">
<div></div>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<script type="text/javascript">
var a=document.getElementsByTagName('input');
function CheckAll(){
for(i=0;i<a.length;i++)
{a[i].checked=true};
};
function UnCheck(){
for(i=0;i<a.length;i++)
{a[i].checked=false};
};
function othercheck(){
for(i=0;i<a.length;i++)
{
if(a[i].checked==true){a[i].checked=false;}
else{ a[i].checked=true};
}
};
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
div{
widows: 100%;
height: 2px;
background: #888;
margin-top: 10px;
}
</style>
</head>
<body>
<input type="button" value="全选" οnclick="CheckAll()">
<input type="button" value="不选" οnclick="UnCheck()">
<input type="button" value="反选" οnclick="othercheck()">
<div></div>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<input type="checkbox"><br/>
<script type="text/javascript">
var a=document.getElementsByTagName('input');
function CheckAll(){
for(i=0;i<a.length;i++)
{a[i].checked=true};
};
function UnCheck(){
for(i=0;i<a.length;i++)
{a[i].checked=false};
};
function othercheck(){
for(i=0;i<a.length;i++)
{
if(a[i].checked==true){a[i].checked=false;}
else{ a[i].checked=true};
}
};
</script>
</body>
</html>