$("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");
            //}        

  

相关文章:

  • 2021-12-04
  • 2021-12-09
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-12-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2021-12-09
相关资源
相似解决方案