linksNN 2   IE 3   DOM n/a

A collection of all A elements whose assigned HREF attributes make them behave as links (instead of only anchors). Collection members are sorted in source code order. Navigator and Internet Explorer let you use array notation to access a single link in the collection (document.links[0] or document.links["section3"], for example). Internet Explorer 4 also allows the index value to be placed inside parentheses instead of brackets (document.links(0), for example). If you wish to use the link's name as an index value (always as a string identifier), be sure to use the value of the NAME attribute, rather than the ID attribute. To use the ID attribute in a reference to an anchor, access the object via a document.all.elementID reference.

 
 
Object Model Reference
NN document.links[i]
IE document.links(i)
document.links[i]
lengthNN 2   IE 3   DOM n/a
 Read-only
 

Returns the number of elements in the collection.

 
Example
var howMany = document.links.length
 
Value
Integer.