<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
function allCheck(){
var allEmail = document.getElementsByName("allEmail")[0];
var emails = document.getElementsByName("email");
if(allEmail.checked){
for(var i=0;i<emails.length;i++){
emails[i].checked = true;
}
}
else{
for(var i=0;i<emails.length;i++){
emails[i].checked = false;
}
}
}
</script>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<center>
<form>
全选<input type="checkbox" onclick="allCheck()" name="allMail"><br><br><br>
<input type="checkbox" name="email"><br>
<input type="checkbox" name="email"><br>
<input type="checkbox" name="email"><br>
<input type="checkbox" name="email"><br>
</form>
</center>
</body>
</html>
//想单机全选,下边的几个复选框也跟着选中,不知哪错了,求大神修改 |