首页 > Web开发 > 详细

jquery实现checkbox的全选

时间:2016-10-08 16:35:56      阅读:242      评论:0      收藏:0      [点我收藏+]

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>jQuery实现CheckBox全选、全不选</title>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
function checkAll(obj){
$("#box input[type=‘checkbox‘]").prop(‘checked‘, $(obj).prop(‘checked‘));
}
</script>

</head>
<body>
<div id="box">
<input type="checkbox" onclick="checkAll(this)">全选<br><br>
<input type="checkbox"><br>
<input type="checkbox"><br>
<input type="checkbox"><br>
<input type="checkbox"><br>
<input type="checkbox"><br>
<input type="checkbox"><br>
<input type="checkbox"><br>
<input type="checkbox"><br>
<input type="checkbox"><br>
</div>
</body>
</html>

jquery实现checkbox的全选

原文:http://www.cnblogs.com/pcx105/p/5938823.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!