<html>
<head>
<title>test1.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">
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$("#button_show").click(function() {
$("#age").show();
});
$("#button_hide").click(function() {
$("#age").hide();
});
});
function selectAll(field) {
$(":checkbox[name='empId']").attr("checked", field.checked);
}
</script>
</head>
<body>
用户:<input type="text" id="username"><br>
年龄:<input type="text" id="age"><br>
<input type="button" value="显示" id="button_show">
<input type="button" value="隐藏" id="button_hide">
<input type="checkbox" name="empId" οnclick="selectAll(this)"/>全选</br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId"/ ></br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId" /></br>
</body>
</html>
<head>
<title>test1.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">
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$("#button_show").click(function() {
$("#age").show();
});
$("#button_hide").click(function() {
$("#age").hide();
});
});
function selectAll(field) {
$(":checkbox[name='empId']").attr("checked", field.checked);
}
</script>
</head>
<body>
用户:<input type="text" id="username"><br>
年龄:<input type="text" id="age"><br>
<input type="button" value="显示" id="button_show">
<input type="button" value="隐藏" id="button_hide">
<input type="checkbox" name="empId" οnclick="selectAll(this)"/>全选</br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId"/ ></br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId" /></br>
<input type="checkbox" name="empId" /></br>
</body>
</html>