disable a hyperlink using jQuery

后端 未结 11 1684
悲&欢浪女
悲&欢浪女 2020-11-29 02:06
Click me

I did

$(\'.my-link\').attr(\'disabled\', true);
11条回答
  •  隐瞒了意图╮
    2020-11-29 02:39

    The disabled attribute isn't valid on all HTML elements I believe, see the MSDN article. That and the proper value for disabled is simply "disabled". Your best approach is to bind a click function that returns false.

提交回复
热议问题