zoukankan      html  css  js  c++  java
  • 全选框

    <script type="text/javascript">  
        // 全选按钮选中标志 
        var checkflag = "false"; 
        // 全选功能 
        function selectAll(name){ 
            var field = document.getElementsByName(name); 
            // 如果全选按钮状态是未选中 
            if (checkflag == "false"){ 
                for (i = 0; i < field.length; i++){ 
                    field[i].checked = true; 
                } 
                // 更改全选按钮选中标志 
                checkflag = "true"; 
            }else{ 
                for (i = 0; i < field.length; i++){ 
                    field[i].checked = false;  
                } 
                // 更改全选按钮选中标志 
                checkflag = "false"; 
            } 
        } 
     
    </script>

    -----------------------html-------------------------------

      <thead>
                <tr>
                    <th><input type="checkbox" value="全选" onClick="selectAll('userIds')">&nbsp;&nbsp;选择</th>
                    <th>登录名</th>
                    <th>姓名</th>
                </tr>
            </thead>
            <tbody>
                <c:forEach items="${users}" var="item">
                <tr>
                    <td><input id="userId_${item.id}" name="userIds" type="checkbox" value="${item.id}" ></td>
                    <td>${item.loginName}</td>
                    <td>${item.name}</td>
                </tr>
                </c:forEach>
            </tbody>

  • 相关阅读:
    Linux 显示当前时间
    Jenkins 更改工作目录;
    Jenkins 编译 .net 项目
    Jenkins 通过 maven 构建编译 JAVA 项目环境
    Jenkins
    Zatree
    Zabbix 邮件报警示例
    Zabbix 短信报警示例
    Linux 检测出口IP地址
    数据结构与算法面试题80道(4)
  • 原文地址:https://www.cnblogs.com/quanfu2326/p/4313327.html
Copyright © 2011-2022 走看看