html文件
<tr>
<th></th>
<td>
<a class="easyui-linkbutton" style="width:60px;" onclick="selectAll()">全选</a>
<a class="easyui-linkbutton" style="width:60px;" onclick="unSelectAll()">全不选</a>
</td>
</tr>
JS文件
//给相同名称的CheckBox赋属性值
function selectAll(){ $(‘input[name="groupItem"]‘).val(function(index,val){ $(this).prop(‘checked‘,true);
//$(this).attr(‘checked‘,true);//错误 return val; }) } function unSelectAll(){ $(‘input[name="groupItem"]‘).val(function(index,val){ $(this).prop(‘checked‘,false);
//$(this).attr(‘checked‘,false);错误 return val; }) }
原文:http://www.cnblogs.com/mr-wuxiansheng/p/6863941.html