全选与取消【jQuery实例】
2017-06-19 15:19
246 查看
//页面部分 <label style="color:#444;">全选:</label><input type="checkbox" onclick="selectall()" id="check_box" title="全选"> //全选jQ部分 function selectall() { if($('#check_box').prop('checked')) { $(':checkbox').prop('checked', true); }else{ $(':checkbox').prop('checked', false) } }
//第二种方法 function selectAll(){ var obj=document.getElementById('check_box'); if(obj.checked==true){ $('form#group_list_info input[type="checkbox"][name="groupids[]"]').each(function(index,element){ this.checked=true; }) }else{ $('form#group_list_info input[type="checkbox"][name="groupids[]"]').each(function(index,element){ this.checked=false; }) } }
相关文章推荐
- jQuery菜单实例(全选,反选,取消)
- 如何利用jquery实现一句话全选/取消全选的实例代码
- ASP.NET jQuery 实例6 (实现CheckBoxList成员全选或全取消)
- ASP.NET jQuery 实例6 (实现CheckBoxList成员全选或全取消)
- Jquery-全选和取消的一个坑
- checkbox全选/取消全选以及checkbox遍历jQuery实现代码
- jquery 全选/取消
- 全选复选框和取消所有复选框 jquery全选复选框 js全选复选框
- jquery实现checkbox全选,反选,取消选择
- jQuery--checkbox全选/取消全选
- CHECKBOX全选,取消全选-jquery
- jQuery--checkbox全选/取消全选
- jquery的attr和removeAttr实现checkbox全选和取消全选问题
- Jquery 复选框全选,反选,取消
- JQuery实例 -- 全选
- Ajax 全选、反选、取消、添加、删除、更新Checkbox实例
- Jquery的全选和取消
- jquery实现点击复选框,勾选所有复选框,再次点击取消全选
- jQuery checkbox复选框全选功能的实例
- Jquery 实现checkbox全选/取消全选