You have three options:
- always return
false
in the handler or callpreventDefault
on the event - use
href="javascript:void(0)"
(which hurts my eyes) - place some sort of special class or data attribute on the links that you don't want to be navigable and create some generic handler that always prevents the navigation
- use
<button>
whenever you are using<a>
with a dummyhref
right now
In my opinion, the last option is the best, because it's clear that these GUI elements perform some action that is 'local' to the content you are showing at the moment, while links (or rather: URIs they link to) are by design representing different resource (and content).