日期:2014-05-16 浏览次数:20418 次
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script>
<!--
function CheckAll(){
var object = event.srcElement;
for(var i = 0;i<document.all.length;i++){
if(document.all(i).id.indexOf("checkbox")!=-1){
if(object.checked)
document.all(i).checked=true;
else
document.all(i).checked=false;
}
}
}
-->
</script>
</head>
<body>
<input type=checkbox name=apple>苹果</input><p>
<input type=checkbox name=orange>橘子</input><p>
<input type=checkbox name=banana>香蕉</input><p>
<input type=checkbox name=grape>葡萄</input><p>
<input type=checkbox name=peach>桃子</input><p>
<input type=checkbox name=selectAll onclick="CheckAll()">全选</input><p>
</body>