• 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.      } 
  • 相关阅读:
    Component 组件props 属性设置
    template 模版制作
    vue生命周期钩子函数
    Vue.set 全局操作 结构器外面修改数据
    Vue.extend 构造器的延伸
    vue.directive自定义指令
    实战笔记
    实战-第二讲 Vue-cli搭建开发环境
    实战-第一讲 画设计图
    webpack-第03节:配置文件:入口和出口
  • 原文地址:https://www.cnblogs.com/phpzlq/p/8880468.html
Copyright © 2020-2023  润新知