How do I disable a href link in JavaScript?

Try this when you dont want user to redirect on click

<a href="https://stackoverflow.com/questions/5376444/javascript: void(0)">I am a useless link</a>

Leave a Comment