25.1. Anchor: the target of a hypertext linkDOM Level 0: Node Element HTMLElement Anchor25.1.1. Properties
25.1.2. Methods
25.1.3. HTML SyntaxAn Anchor object is created by any standard HTML <a> tag that contains a name attribute: <a name="name"> // Links may refer to this anchor by this name ... </a> 25.1.4. DescriptionAn anchor is a named location within an HTML document. Anchors are created with an <a> tag that has a name attribute specified. The Document object has an anchors[] array property that contains Anchor objects that represent each of the anchors in the document. Anchor objects can be referenced by index or by name within this array. You can make a browser display the location of an anchor by setting the hash property of the Location object to a # character followed by the name of the anchor or by simply calling the focus( ) method of the Anchor object itself. Note that the <a> tag used to create anchors is also used to create hypertext links. Although hypertext links are often called anchors in HTML parlance, they are represented in JavaScript with the Link object, not with the Anchor object. 25.1.5. Example// Scroll the document so the anchor named "_bottom_" is visible document.anchors['_bottom_'].focus( ); 25.1.6. See AlsoDocument, Link, Location |