jQuery disable/enable submit button

后端 未结 21 3120
难免孤独
难免孤独 2020-11-22 07:30

I have this HTML:



How can I do something li

21条回答
  •  臣服心动
    2020-11-22 08:02

    Disable: $('input[type="submit"]').prop('disabled', true);

    Enable: $('input[type="submit"]').removeAttr('disabled');

    The above enable code is more accurate than:

    $('input[type="submit"]').removeAttr('disabled');
    

    You can use both methods.

提交回复
热议问题