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.      } 
  • 相关阅读:
    20101016网站更新部署
    服务器内存技术知识充电
    http://code.google.com/p/pyv8/, pyv8爬虫专用
    十月创意家居,饰品行业热销货源推荐
    2010十一月份日用百货热销品货源推荐
    关于使用cookielib的一些用法
    sqlalchemy group by
    vim使用记录
    javascript insert text on cursor postion
    python网店
  • 原文地址:https://www.cnblogs.com/phpzlq/p/8880468.html
Copyright © 2011-2022 走看看