Skip to content
Advertisement

How do I disable a href link in JavaScript?

I have a tag <a href="#"> Previous </a> 1 2 3 4 <a href="#"> Next </a> and in some conditions I want this tag to be completely disabled.

Code from comments (this is how the link is generated)

JavaScript

Advertisement

Answer

Try this when you dont want user to redirect on click

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