Disable button in jQuery

后端 未结 11 1759
时光说笑
时光说笑 2020-11-28 02:04

My page creates multiple buttons as id = \'rbutton_\"+i+\"\'. Below is my code:

11条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 02:43

    Simply it's work fine, in HTML:

    
    

    In JQuery side put this function for disable button:

    function disableButton() {
        $('.btn_CommitAll').prop("disabled", true);
    }
    

    For enable button:

    function enableButton() {
        $('.btn_CommitAll').prop("disabled", false);
    }
    

    That's all.

提交回复
热议问题