多选框的全选和反选
来源:互联网 发布:云计算行业发展趋势 编辑:程序博客网 时间:2024/06/07 02:04
html:
<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: rgb(255, 255, 255);"></span><pre name="code" class="javascript"><pre name="code" class="html"><span style="font-weight: normal;"><span style="white-space:pre"></span><table><thead><tr><th><input type="checkbox" id="chkAll">全选</th></tr></thead><tbody><tr><td><input type="checkbox"></td></tr><tr><td><input type="checkbox"></td></tr><tr><td><input type="checkbox"></td></tr></tbody></table></span>
jQuery:
//全选
$('#chkAll').bind('click',function(e){
$('tbody input[type=checkbox]').prop('checked',$(this).prop('checked'));
$(this).prop('checked',$('tbody :checked').length==$('tbody tr').length);
});
/*******************************************************************************************/
//反选
$('tbody input[type=checkbox]').bind('click', function(e) { /* Act on the event */
$('#chkAll').prop('checked',$('tbody :checked').length==$('tbody tr').length);
});
0 0
- 多选框的全选和反选
- 多选框全选和反选的例子
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- 全选和反选
- AlertDialog.Builder实现多选框的全选和反选功能
- css 简单的多选框全选全不选和反选
- checkbox的全选和反选
- checkBox的全选和 反选
- listbox的全选,反选和全不选
- Dom的全选和反选
- checkBox的全选和反选
- Sqlserver查询数据库文件大小和剩余空间
- 数字化和社会化商业转型中首席信息官的作用
- ElasticSearch默认的分页参数 size
- ConcurrentHashMap的实现原理和源码分析
- git&github常用命令
- 多选框的全选和反选
- eclipse最有用快捷键整理
- No tests found matching 【junit 异常】
- Jpush使用总结 _ 客户端定义通知栏样式
- 你不要太天真,招聘广告到底能信几成?
- 从PHP语法糖剖析Zend VM引擎
- 【Android 界面技巧】输入框不聚焦,以及首次点击清空输入框
- SpringMvc自定义拦截器
- 【Web】Jsp基础学习