Programming Tips - How do I make a link that does nothing?

Date: 2011feb3 Platform: web Q. How do I make a link that does nothing? A. Use void(0) like this:
<a href="javascript:void(0)">a link that does nothing</a>
This will look like regular link but will not reload the current page or anything. (Unlike href=#) Now, you can use other techniques to make it do something useful. Regular javaScript:
<a href="javascript:void(0)" onClick="doStuff()">a link that does nothing</a>
With jQuery:
<a id=mylink href="javascript:void(0)">a link that does nothing</a> $('#mylink').click(doStuff); // or $('#mylink').click(function(){ // do things });