jquery全选反选

xiaoxiao2026-08-22  11

 <input type="button" class="btn_selectallbg" id="checkall2" value="全选" />

<input type="checkbox"  name="groupId[]"  value="遍历的某列值 " />

 

 // 给全选按钮添加全选功能     $('#checkall2').toggle(function(){             $("input[name='groupId[]']").each(function(){                 $(this).attr('checked',true);             });             $(this).attr('value','取消');         },function(){             $("input[name='groupId[]']").each(function(){                 $(this).attr('checked',false);             });             $(this).attr('value','全选');         }

 

转载请注明原文地址: https://www.6miu.com/read-5051649.html

最新回复(0)