Disable/enable an input with jQuery?

后端 未结 18 2712
礼貌的吻别
礼貌的吻别 2020-11-21 07:47
$input.disabled = true;

or

$input.disabled = \"disabled\";

Which is the standard way? And, conversely, how do yo

18条回答
  •  后悔当初
    2020-11-21 07:57

    Disable true for input type :

    In case of a specific input type (Ex. Text type input)

    $("input[type=text]").attr('disabled', true);
    

    For all type of input type

    $("input").attr('disabled', true);
    

提交回复
热议问题