Forum Moderators: open

Message Too Old, No Replies

<a href="#top"></a>

undocumented way to set link target to top of the page?

         

bill

6:59 am on Dec 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I can't seem to find any information on this, so I thought I'd ask you guys.

Using this code

<a href="#top"></a>

with some browsers like IE, Opera and some older versions of Netscape seems to work as a simple way to have the user jump back to the top of the respective page without having to add
<a name="top"></a>

to the top of every page.

Is it supposed to work like this, or is this just a quirk with the browsers? I can't seem to get this to work with Mozilla.

txbakers

7:06 am on Dec 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it will also work with just the # symbol.

dcheney

7:11 am on Dec 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it works with any undefined name. try #fred

toadhall

3:42 pm on Dec 12, 2002 (gmt 0)

10+ Year Member



> is this just a quirk with the (some) browsers

Yes, it is. So best to stick to the standard method.

bill

4:39 am on Dec 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks. I guess it is always better to stick to the standards in cases like this.

ggrot

6:12 am on Dec 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it will also work with just the # symbol.

Actually, this is not the case. I use the # symbol frequently as a blank link so I can perform javascript events on the link object. Its safe with older browsers and those that don't support javascript. It just links to the current location in the same page (ie: clicking it does nothing).