ElGabbu ElGabbu - 11 months ago 63
HTML Question

html anchor works only once

I am ashamed to say that I have an anchor issue.

So I have this code:

<a name="map"></a>

$("div.store_list").click(function() {
//do some stuff
location.href = location.href + '#map'

When doing the first click it works fine. And the URL changes to:


Second click the URL changes to the following and it doesn't work:


Any suggestions? Thanks


Issue was solved using: document.location = "#map";