Your example works fine but it's not really what I'm looking for as I have the real url as href because I want the link to work if someone opens in a new window/tab.
I tried to modify your example to take the real url with hash but that didn't work. I wonder if this could be done with a html5 solution.
