<body>
<script>
function checkAll()
{
var obj_all = document.getElementsByTagName("INPUT");
for(i=0;i<obj_all.length;i++)
if(obj_all[i].type=="checkbox")
obj_all[i].checked = true;
}
</script>
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="button" onclick="checkAll()" value="看着啦">
</body>
<script>
function checkAll()
{
var obj_all = document.getElementsByTagName("INPUT");
for(i=0;i<obj_all.length;i++)
if(obj_all[i].type=="checkbox")
obj_all[i].checked = true;
}
</script>
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="button" onclick="checkAll()" value="看着啦">
</body>