On the page there is a link:

<a href="#" id="SendRecord" disabled="disabled"><span>Записать</span></a> 

Can JS make it inactive for hover (CSS) and click (js) events?

    2 answers 2

     <a href="#" id="SendRecord" disabled="disabled"><span>Записать</span></a> $('a[disabled]').click(function(e){ e.preventDefault(); $(this).addClass('disabled-link'); }); 

    I did not check it, but in theory it should work, you hang up a style with a disabled-link style with disabled hovers.

    • With the hovercases disabled, what is the CSS property? Probably pointer-events: none - Jony

    event.preventDefault () : This will not be triggered.

    • The fact is that the link should be inactive not immediately, but from the result of the response from Ajax. - Jony
    • one
      And what confuses you? - nörbörnën
    • success: {// how to use event.preventDefault () here for reference? } - Jony
    • Onclick on the link hang and remove the default action. You can also change the styles so that you can see that the link is inactive. - andreyqin
    • @Oleg Ponomarchuk, of course not. This method will help you to stop the events on the link. - nörbörnën