Clicking a disabled input or button

后端 未结 9 1429
星月不相逢
星月不相逢 2020-11-28 13:12

Is it possible to click on a disabled button and provide some feedback to the user?

HTML:


         


        
9条回答
  •  [愿得一人]
    2020-11-28 13:44

    you can't click on disabled button, but can click on disabled link

    $('.btn').on('click', function(e) {
      e.preventDefault();
      $txt = $('div.text');
      if($(this).attr('disabled')){
        $txt.html('CLICKED, BUT DISABLED!!');
      }else{
        $txt.html('Not disabled. =)');
      }
    });
    
    
    No action
    Click Click Disabled

提交回复
热议问题