I'm facing a situation where I have a button that triggers some logic in jQuery when clicked. However, after a series of other events, I want the button click to no longer have any effect. What would be the preferable method to achieve this - using
$(".myBtn").off(click.mynamespace)
or $(".myBtn").css("pointer-events", none);
?
In my opinion, setting pointer-events to none completely disables all click, focus, and hover actions on the button. On the other hand, utilizing jQuery's off function simply prevents any previously assigned .click()
events from executing.