Anchor

JavaScript 1.2+, JScript 3.0+ Nav4+, IE 4+ Syntax

Core client-side JavaScript object.

Description

An instance of the Anchor object is created with each instance of the <a> tag with the NAME attribute set. An anchor itself is a point in an HTML document that can be reached by using a hypertext link. The hypertext link that references an anchor can appear within the same document as the anchor or in a completely different Web page. In either case, anchors allow access to specific parts of Web pages rather than always displaying the top of a document when a Web page is loaded in a browser. For an anchor to act like an anchor, the NAME property must be set for hyperlinks to reference the anchor's position in the document.

In HTML, the ...

Get Pure JavaScript 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.