zoukankan      html  css  js  c++  java
  • jquery(复选框全选)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script src="heiheihei/jquery-1.11.2.min.js"></script>
    </head>

    <body>
    <h1>全选效果</h1>
    <div><input type="checkbox" value="qx" id="qx" />全选</div>
    <br />

    <div>
    <input type="checkbox" value="1" class="ck" /> polo
    <input type="checkbox" value="1" class="ck" /> 迈巴赫
    <input type="checkbox" value="1" class="ck" /> 长城
    <input type="checkbox" value="1" class="ck" /> 兰博基尼
    <input type="checkbox" value="1" class="ck" /> 法拉利
    <input type="checkbox" value="1" class="ck" /> 蚯蚓
    <input type="checkbox" value="1" class="ck" /> 激励
    <input type="checkbox" value="1" class="ck" /> 萨拉黑
    <input type="checkbox" value="1" class="ck" /> 巴扎黑

    </div>
    </body>
    <script type="text/javascript">
    $("#qx").click(function(){
        var xz = $(this).prop("checked");  //prop 只在写复选框时使用
        //var xz = $(this).prop("checked");
        $(".ck").prop("checked",xz);
        })

    </script>
    </html>

  • 相关阅读:
    oralce索引的使用
    oracle中connect by prior的使用
    oracle函数listagg使用
    oracle函数的使用
    redis高可用集群搭建
    Node.js安装及环境配置之Windows篇
    Repeater 合并单元格
    c#16进制转浮点数单精度类型
    EF Core 实体映射表或视图
    docker 构建filebeat镜像
  • 原文地址:https://www.cnblogs.com/zhangbaobao/p/6841329.html
Copyright © 2011-2022 走看看