Skip to content
Advertisement

Disable href with jquery/js

I am having difficulties in disabling href links through jquery. I am using this method I modified. Can some please advise or help me in figuring this out? Thank you.

jquery/js

JavaScript

html

JavaScript

Advertisement

Answer

You can use preventDefault(); to disable the default behaviour of links (which is, to navigate to the given href).

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement