Search code examples
javascripthtmlgoogle-chromehyperlinkhref

how to prevent scroll up on chrome for a href="#"


So basically I have

 <a href="#" onClick="return false">Link</a> 

And return false is there so that it wont' scroll up when you click on it. This works in IE and Firefox, but in chrome it still scrolls up nonetheless...

How do you prevent this from happening in Chrome?

Thanks in advance

There is no spoon

-The Matrix


Solution

  • Use: <a href="javascript:;">Link</a>