//实现checkbox的全选和取消
<script type="text/
javascript">
function all(all){
var checkbox = document.getElementsByName("select");
if (all.
checked){
for (i = 0;i<checkbox.length ;i++ )
{
checkbox[i].checked = true;
}
}
else{
for (i = 0;i<checkbox.length ;i++ )
{
checkbox[i].checked = false;
}
}
}
</script>
<style type="text/css">
</style>
</head>
<body>
<input type = "checkbox" onchange = "javascript:all(this)"/>全选<br/>
<input type = "checkbox" name = "select"/>苹果
<input type = "checkbox" name = "select"/>香蕉
<input type = "checkbox" name = "select"/>橘子
<input type = "checkbox" name = "select"/>荔枝
<input type = "checkbox" name = "select"/>橙子
<input type = "checkbox" name = "select"/>哈密瓜
</body>