zoukankan      html  css  js  c++  java
  • jquery各种操作复选框(全选、全不选、自动勾选、反选……)

    1. $('#checkAll').click(function(){  
    2.             if(this.checked) {  
    3.                 $("input[type=checkbox][name=ckjsmc]").each(function(){  
    4.                     $(this).attr('checked', 'true');  
    5.                 });  
    6.             } else {  
    7.                 $("input[type=checkbox][name=ckjsmc]").each(function(){  
    8.                     $(this).removeAttr('checked');  
    9.                 });  
    10.             }  
    11.         });  
    12.           
    13.      function checkOne(){  
    14.         var count = 0;  
    15.         $("input[type=checkbox][name=ckjsmc]").each(function(){  
    16.             if($(this).attr('checked') != 'checked'){// 判断一组复选框是否有未选中的  
    17.                 count+=1;  
    18.             }  
    19.         });  
    20.         if(count == 0) { // 如果没有未选中的那么全选框被选中  
    21.             $('#checkAll').attr('checked', 'true');  
    22.         } else {  
    23.             $('#checkAll').removeAttr('checked');  
    24.         }  
    25.      } 
  • 相关阅读:
    Extjs5.0中的新特性
    Extjs4中的常用组件:Grid、Tree和Form
    Extjs4中的布局
    Extjs4中的store
    [IIS]IIS扫盲(三)
    [IIS]IIS扫盲(二)
    [IIS]IIS扫盲(一)
    [IIS]在CMD中IIS的使用
    检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时失败
    [SQL]向3个表插入数据的存储过程 和 C# 代码
  • 原文地址:https://www.cnblogs.com/phpzlq/p/8880468.html
Copyright © 2011-2022 走看看