复选框选中取消全选状态

<input type="checkbox" name="clientIds" value="" onclick="javascript:onclickClient(this);checkSelected();">

checkbox有一个没有选中,全选按钮应该取消选中状态

function checkSelected(){
   if ($("input[name='clientIds']").length == $("input[name='clientIds']:checked").length) {
      $('#selectAll').attr('checked', true);
   } else {
      $('#selectAll').attr('checked', false);
   }
}

猜你喜欢

转载自www.cnblogs.com/suni/p/10875603.html