Anchor

All anchors on a page are stored in the document's anchor array: window.document.anchors[].

Example:

<a name = "some_name"></a>

Properties

hash

FF, IE 3

Contents of an anchor after the # character

host

FF, IE 3

Hostname and the port of a link

hostname

FF, IE 3

Hostname of an anchor

href

FF, IE 3

href of the anchor

name

FF, IE 4

Anchor tag's name

pathname

FF, IE 3

Part of an anchor after the host

port

FF, IE 3

Port of an anchor (usually null)

protocol

FF, IE 3

Protocol of an anchor (http and ftp are the most common)

rel, rev

FF, IE 3

Additional attribute, called rel or rev, used in some anchors to add more information about the link

search

FF, IE 3

Part of an anchor following the ? character

target

FF, IE 3

HTML target of an anchor

Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.