• JQuery 判断复选框是否选中


    $("input").attr("checked") == "checked" or "undefined"
    
    $("input").prop("checked") == true or false
    

      这种可以 

    博客园找到一个沙雕博主骗人 骗我用这种 不可以 

    //$("input").prop("checked") 
        
                //可以
                if ($("#IsBuyGiveFund").prop("checked") == true)
                {
                    $('#BuyGiveFundAmount').removeAttr("readonly");
    
                }
                else {
                    $('#BuyGiveFundAmount').val("");
                    $('#BuyGiveFundAmount').attr("readonly", "readonly");
                }
    
                //不可以
                //if ($("#IsBuyGiveFund").attr("checked") == true)
                //{
                //    $('#BuyGiveFundAmount').removeAttr("readonly");
                   
                //}
                //else
                //{
                //    $('#BuyGiveFundAmount').val("");
                //    $('#BuyGiveFundAmount').attr("readonly", "readonly");
                //}        
    

      

  • 相关阅读:
    20170728xlVba SSC_TODAY
    卸载angular版本
    union 共用体
    bootstrap的粗认识
    结构体,结构体数组,结构体指针
    C语言的枚举
    nodeJS 的认识
    nodejs 平台搭建
    动态表单
    指针
  • 原文地址:https://www.cnblogs.com/zhangxiaoxia/p/11314258.html
Copyright © 2020-2023  润新知