AvailabilityJavaScript 1.2 Inherits from/OverridesInherits from HTMLElement Synopsisdocument.anchors[i] document.anchors.length PropertiesAnchor inherits properties from HTMLElement and defines or overrides the following:
HTMLElement.innerText provides the IE 4 equivalent of this Netscape-specific property. 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 > text </a> 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. This anchors[] array has existed since JavaScript 1.0, but the Anchor object was not implemented until JavaScript 1.2. Therefore, the elements of anchors[] were null until JavaScript 1.2. 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. In the DOM reference section of this book, however, both anchors and links are documented under HTMLAnchorElement. See Alsoanchors[] property of the Document object, Link; HTMLAnchorElement in the DOM reference section |