<script language="javascript">
function test(all){
var arr = document.all.temp;
for(var i=0;i<arr.length;i++){
arr[i].checked = all.checked;
}
}
</script>
<input type="checkbox" onclick="test(this)">全选<br>
<input type="checkbox" name="temp">testaa<br>
<input type="checkbox" name="temp">testaa<br>
<input type="checkbox" name="temp">testaa<br>