Is there a way to make a null link besides these methods?
<a href="javascript:;">Example</a>
<a href="javascript:void(0);">Example</a>
<a href="#">Example</a>
I don’t mind something that makes the page jump to the top but I don’t want it to alter the URL in the address bar. The ideal link would be one as similar as possible to the ones featured on navigation boxes on Wikipedia but there is much more to that link than meets the eye as it has a pretty large script associated with it. I’m just looking for something to put into the a tag.
Thanks in advance.
You just want something you can shove in the
<a>tag? OK: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: