Different methods to make a null link?
You just want something you can shove in the <a>
tag? OK:
<a href="#" onclick="return false;">Example</a>
Combine it with any of the href=
methods from your question.
Given that a link that doesn't go anywhere is fairly useless, can I assume you want to kick off some JavaScript function when the link is clicked? If so, do this:
<a href="#" onclick="yourFunctionHere(); return false;">Example</a>
The # method is the simplest, and is always compatible. Using a href=# however, will jump to the top of the page. To prevent the jump, simply reference an unnamed anchor. Like this:
<a href=#nothing >This link has a null href!</a>
<a href=#doesnotexist >This link has a null href!</a>
<a href=#null >This link has a null href!</a>
<a href=#void >This link has a null href!</a>
<a href=#whatever >This link has a null href!</a>