zoukankan      html  css  js  c++  java
  • jquery实现checkbox的全选

    <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>
  • 相关阅读:
    JavaScript概述
    JavaScript概述
    python语法基础
    python 网络编程
    python 日志模块
    python 异常处理
    python tricks
    记录_省赛(一)
    异或加密算法
    三目条件运算符
  • 原文地址:https://www.cnblogs.com/pcx105/p/5938823.html
Copyright © 2011-2022 走看看