Wednesday, October 12, 2011

Difference between href="#" and href="javascript:void(0)"

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.

No comments:

Post a Comment