How to disable HTML links

后端 未结 14 1362
刺人心
刺人心 2020-11-22 13:00

I have a link button inside a which I have to disable. This works on IE but not working in Firefox and Chrome. Structure is - Link inside a <

14条回答
  •  抹茶落季
    2020-11-22 13:31

    I think a lot of these are over thinking. Add a class of whatever you want, like disabled_link.
    Then make the css have .disabled_link { display: none }
    Boom now the user can't see the link so you won't have to worry about them clicking it. If they do something to satisfy the link being clickable, simply remove the class with jQuery:
    $("a.disabled_link").removeClass("super_disabled"). Boom done!

提交回复
热议问题