<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<script src="JS/jquery-1.3.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("#checkall").click(
function(){
if(this.checked){
$("input[name='checkname']").attr('checked', true)
}else{
$("input[name='checkname']").attr('checked', false)
}
}
);
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="checkall" type="checkbox" value="全选" />全选
<input type="checkbox" value="1" name="checkname" />
<input type="checkbox" value="2" name="checkname" />
<input type="checkbox" value="3" name="checkname" />
<input type="checkbox" value="4" name="checkname" />
</div>
</form>
</body>
</html>
checkbox用法
最新推荐文章于 2024-09-10 12:58:32 发布