<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="js/jquery-2.2.2.js"></script>
<script language="JavaScript">
$(function(){
$("#qx").click(function(){
if($(this).prop('checked')){
$("input").prop('checked',true);
}else{
$("input").prop('checked',false);
}
})
})
</script>
</head>
<body>
<input type="checkbox" id="qx"/><label for="qx">全选</label>
<input type="checkbox" id="read"/><label for="read">阅读</label>
<input type="checkbox" id="sport"/><label for="sport">运动</label>
<input type="checkbox" id="sleep"/><label for="sleep">睡觉</label>
<input type="checkbox" id="swim"/><label for="swim">游泳</label>
</body>
</html>
多选框全选全不选代码
最新推荐文章于 2022-04-13 20:46:09 发布