<!DOCTYPE html>
<html>
<head>
<title>allSelected.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script language = "javascript" type = "text/javascript">
function allSel(){
var names = document.getElementsByName("name1");
for(i=0;i<names.length;i++){
if(myselect.checked){
names[i].checked = true;
}else{
names[i].checked = false;
}
}
}
</script>
</head>
<body>
<input type = "checkbox" name = "name1">hello<br/>
<input type = "checkbox" name = "name1">hi<br/>
<input type = "checkbox" name = "name1">good<br/>
<input type = "checkbox" name = "name1">ok<br/>
<input type = "checkbox" name = "name1">yes<br/>
<input type = "checkbox" name = "name1">no<p/>
<input id = "myselect" type = "checkbox" onclick = "allSel()">全选
</body>
</html>