首页 > Web开发 > 详细

PHP全选按钮

时间:2016-05-10 12:25:02      阅读:197      评论:0      收藏:0      [点我收藏+]
<body>
<input type="checkbox"  id="qx"  onclick="qxx(this,‘qx‘)"/>全选
<input type="checkbox"  class="qx"  />内容
<input type="checkbox"  class="qx"  />内容
<input type="checkbox"  id="qy"  onclick="qxx(this,‘qy‘)"/>全选
<input type="checkbox"  class="qy"  />内容
<input type="checkbox"  class="qy"  />内容
</body>
<script>
function qxx(a,b)  //a代表点击的 b代表class名称
{
    var a=a.checked;
    var b=document.getElementsByClassName(b);
    for(var i=0;i<b.length;i++)
    {
        b[i].checked=a;
    }
}

</script>
</html>

 

PHP全选按钮

原文:http://www.cnblogs.com/zbxiaoxu/p/5477295.html

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