Document.links[] (Collection)

An array of links in the document.

Availability:

DOM level - 1
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Opera - 3.0
Property/method value type:LinkArray object
JavaScript syntax:-myDocument.links
HTML syntax:<A> <AREA>

This is a collection of link objects, each one corresponding to an anchor or area tag in the document. This array may be identical to the anchors[] array if there are no <AREA> tags present.

Note that in Netscape , the class type for these link objects is actually Url and so they are described in detail at that point in the lexically sorted topics.

Objects are added to this array if they are hyperlinks. Simple named anchors do not qualify for addition to this array although they would be added to the array accessible via the document.anchors property. The anchors, and links arrays allow you to distinguish easily between internal and external HREF values. It is slightly confusing in that all <A> tags will be members of the anchors array while only externally linking <A> tags and all <AREA> tags will be in the links array.

DOM level 1 requires that this collection should include all objects instantiated by <AREA> and <A> HTML tags which contain an HREF="..." HTML tag attribute.

Warnings:

See also:Anchor object, Document object, Document.anchors[], Element.all[], LinkArray object, LinkArray.length, Security policy, Url object, Url.name

Property attributes:

ReadOnly.