复选框全选反选问题
2017-06-21 09:59
239 查看
<script type="text/javascript"> $(function(){ $("#dispatch_btn").click(function(){ var array = []; $('input[name=chk_list]').each(function(){ if($(this).is(':checked')) array.push($(this).parent().next().val()); }); console.log(array); }); }); function allCheck(e){ console.log("%o",e); if($("#chkall").is(':checked')){ $('input[name=chk_list]').each(function() { console.log(this); $(this).prop("checked", true); }); } else { $('input[name=chk_list]').each(function() { console.log(this); $(this).removeAttr("checked"); }); } } </script>
springmvc控制器端可直接用String[]接受数组参数
注意点:
$(this).attr("checked",true)这种方式有可能只有一次生效,原因不明
相关文章推荐
- 关于复选框全选反选问题的实例
- 嘿牛程序员__成都传智博客__JavaScript中的复选框的全选、反选问题
- jQuery实现复选框全选、全不选、反选问题解析
- js实现复选框全选和反选功能
- jquery做复选框的全选、全部选、反选更加简单
- 遇到的一个html控件checkbox全选反选问题后台取值问题
- JavaScript中复选框的全选和反选功能的实现
- js全选 复选框的问题
- 用jquery实现复选框全选全不选问题(完整版),在网络上怎么也找不到完整的解决方案,重要搞全了
- 【js】js复选框全选反选全不选案例
- 【js】赵雅智_js复选框全选反选全不选案例
- JSF复选框全选问题
- asp.net DataList 复选框 也玩 全选反选全不选 by shawl.qiu
- DeveXpress ASPxGridView获取要批量删除或者批量更改的Id(AspxGridView复选框的全选|反选功能)
- jQuery实现checkbox(复选框)选中、全选反选代码
- JQuery之复选框的全选、全不选、反选功能
- js全选 复选框的问题
- js全选 复选框的问题
- 复选框全选/反选代码
- 解决GridPager分页组件复选框不能全选问题