Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q1254 What are the different ways of accessing an anchor

You are here: irt.org | FAQ | JavaScript | Link | Q1254 [ previous next ]

The following code will all move the browser to the 5th anchor on the page in a frame named main. Please note that Internet Explorer 4 does not like to go to a named anchor using the anchors array so either use document.all.anchor5 or document.anchors[4]

Remove parent.main. and TARGET="main" if the anchor is on the same page as the link to it.

<a href="anchors.htm" target="main"> href=anchors.htm</a>


<a href="anchors.htm#anchor5" target="main">anchors.htm#anchor5</a>


<a href="javascript:;" onClick="
    return false;


<a href="javascript:;" onClick="
    if (document.layers)
        if (document.all)
    return false

©2018 Martin Webb