Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 1
    Thank you. Where does <a href="javascript:;"></a> fit into this scheme? Commented Apr 23, 2014 at 9:59
  • href="" will link to the same page as the one you are currently on, effectively refreshing the page. href="#" will not refresh the page, but using the # will make the screen move to the top of the page (it is the browser effectively looking for an anchor with no name, ). javascript:void(0) will prevent anything happening on the link at all. Commented Apr 23, 2014 at 10:04
  • Thank you again, but you haven't addressed my question about href="javascript:;" Commented Apr 23, 2014 at 10:06
  • When we create a link for solve our purpose to run JavaScript code, there are 2 ways to write the code. Which is better, in terms of functionality, page load speed, validation purposes, etc? <a href="#" onclick="myJsFunc();">Run JavaScript Code</a> <a href="javascript:void(0)" onclick="myJsFunc();">Run JavaScript Code</a> Commented Apr 23, 2014 at 10:11
  • I understand, but you still haven't mentioned href="javascript:;". Where does it fit into this scheme? Commented Apr 23, 2014 at 10:14