jQuery disable/enable submit button

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

I have this HTML:



How can I do something li

21条回答
  •  逝去的感伤
    2020-11-22 07:48

    We can simply have if & else .if suppose your input is empty we can have

    if($(#name).val() != '') {
       $('input[type="submit"]').attr('disabled' , false);
    }
    

    else we can change false into true

提交回复
热议问题