zoukankan      html  css  js  c++  java
  • jquery 基础

    转载自:http://www.wufangbo.com/jquery-pan-duan-checked/

    jquery判断checked的三种方法:
    .attr('checked):   //看版本1.6+返回:”checked”或”undefined” ;1.5-返回:true或false
    .prop('checked'): //16+:true/false
    .is(':checked'):    //所有版本:true/false//别忘记冒号哦
    jquery赋值checked的几种写法:
    所有的jquery版本都可以这样赋值:
    // $("#cb1").attr("checked","checked");
    // $("#cb1").attr("checked",true);
    jquery1.6+:prop的4种赋值:
    // $("#cb1″).prop("checked",true);//很简单就不说了哦
    // $("#cb1″).prop({checked:true}); //map键值对
    // $("#cb1″).prop("checked",function(){
    return true;//函数返回true或false
    });
    //记得还有这种哦:$("#cb1″).prop("checked","checked");

    js判断checkbox是否选中

    document.getElementById("cb1").checked true or false;

    jquery 设置按钮不可用
     $('#btnRegister').attr("disabled", true);//不可用
     $('#btnRegister').attr("disabled", false);//可用
    $('#btnRegister').removeattr("disabled"); //移除disabled属性

    $('#spn1').css("display", "block");//设置按钮可见

    $('#spn1').css("display", "none");//不可见
    $('#spn1').html("数据库中已存在此用户名!");//给span赋值


     var names = '<%=strAllUserName %>';//记得要有单引号包裹,不然会报语法错误

    --删除表中重复记录,只留有rowid最小的记录 id为主键
    delete from users
    where name in (select name from users group by name having count(name)>1)
    and id not in (select min(id) from users group by name having count(name)>1)

    魔由心生,有万境纵横,无一道清静,无量寿佛!
  • 相关阅读:
    Javascript调用C#后台方法及JSon解析
    ul 仿 table 循环滚动
    windows服务
    simple demo how to get the list of online users
    IIS 4.0配置
    在线
    C学习笔记-多源文件的编译
    C学习笔记-多源文件的编译
    C学习笔记-函数
    C学习笔记-函数
  • 原文地址:https://www.cnblogs.com/qihuan/p/4019560.html
Copyright © 2011-2022 走看看