博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
js 全选
阅读量:4213 次
发布时间:2019-05-26

本文共 742 字,大约阅读时间需要 2 分钟。

Javascript实现表格的全选框:
http://www.cnblogs.com/sanshi/archive/2009/02/17/javascript_table_select_all_checkbox.html
<table border="1" cellpadding="3" cellspacing="0">
    <tr>
        <th>
            <input type="checkbox" οnclick="checkAll(this, 'item1');" />
        </th>
        <th>ID</th>
        <th>用户名</th>
    </tr>
    <tr>
        <td>
            <input type="checkbox" class="item1" />
        </td>
        <td>1001</td>
        <td>张三</td>
    </tr>
    <tr>
        <td>
            <input type="checkbox" class="item1" />
        </td>
        <td>1002</td>
        <td>李四</td>
    </tr>
</table>
function checkAll(sender, checkClass) {
    var checkItems = document.getElementsByTagName('input');
    for (var i = 0; i < checkItems.length; i++) {
        var checkItem = checkItems[i];
        if (checkItem.type === 'checkbox' && checkItem.className === 'item1') {
            checkItem.checked = sender.checked;
        }
    }
}
你可能感兴趣的文章
RMAN 备份报错 RMAN-06207 RMAN-06208 解决方法
查看>>
[INS-35172] Target database memory (XXMB) exceeds the systems available shared memory ({0}MB) 解决方法
查看>>
深入理解 OUI(Oracle Universal Installer)
查看>>
Oracle LOB 详解
查看>>
磁盘性能 -- IOPS 和 吞吐量 说明
查看>>
Oracle Heap size XXK exceeds notification threshold (2048K) 解决方法
查看>>
Oracle Gloden Gate 系列三 -- GG 支持与不支持的对象类型与操作 说明
查看>>
PowerDesigner PDM 生成SQL脚本 去除 引号 方法
查看>>
Oracle Golden Gate 系列四 -- GG 安装 与 卸载 理论知识
查看>>
关系数据库 范式(NF: Normal Form) 说明
查看>>
Oracle Golden Gate 系列五 -- GG 使用配置 说明
查看>>
Oracle Golden Gate 系列六 -- 11gR2 Ora2Ora 单向复制 GG 示例
查看>>
Oracle Golden Gate 系列七 -- 配置 GG Manager process
查看>>
ORA-00600:[32695], [hash aggregation can't be done] 解决方法
查看>>
Oracle SQL中使用正则表达式 执行报ORA-07445 [_intel_fast_memcpy.A()+10] 错误
查看>>
Oracle TABLE ACCESS BY INDEX ROWID 说明
查看>>
ORA-00600 [kmgs_parameter_update_timeout_1], [27072] ORA-27072 解决方法
查看>>
Oracle 11g alert log 新增消息 opiodr aborting process unknown ospid (1951) as a result of ORA-28 说明
查看>>
Linux Context , Interrupts 和 Context Switching 说明
查看>>
《Oracle数据库问题解决方案和故障排除手册》终于发售了
查看>>