0

I have an anchor in a webpage I'm building like this:

<a id="Equity"> </a>

In IE11, the link https://example.com/myPage.html#Equity brings me to the anchor location for a second, and then back to the top of the page. The anchor works correctly with Chrome and Firefox.

I have also tried these, with the same result:

<a name="Equity"> </a>
<div id="Equity"> </div>
<a id="Equity">Some text</a>

Anyone know what could be happening? I've scoured the web without success. I would very much appreciate any help.

Edit: I've discovered that this issue only occurs the first time the URL is loaded in a window/tab. If you refresh the page, it jumps to the anchor correctly, and does not return to the top of the page.

  • I've never experienced the problem myself, and it *shouldn't* be a problem... but according to [*this question*](https://stackoverflow.com/questions/8240554/avoid-window-jump-to-top-when-clicking-links), you might be able solve the problem by affixing a `!` or backslash to the hashtag (as `#!`). Keep in mind though that `` tags need an `href` attribute to actual navigate -- I assume you're using `` or similar. – Obsidian Age Jan 07 '20 at 23:24
  • Obisidian - I think your linked question is a slightly different issue. I'm linking to this anchor from an external page. The anchor I'm linking to is an empty tag, not a link or button itself. Also, I've discovered that my issue only occurs the first time the URL is linked to in a window/tab. If you refresh the page, it jumps to the correct location. – Ryan Corning Jan 08 '20 at 11:20

0 Answers0