linkslinks*
*Contents  *Index  *Topic Contents
*Previous Topic: imports
*Next Topic: options

links

Description

Retrieves a collection of all A elements that specify the HREF= attribute and all AREA elements in the document.

Syntax

object.links(index)

ParameterDescription
object The document object.
(index) Optional. An integer or a string specifying the index value of the element to retrieve. Integer indexes are zero-based, meaning the first element in the collection has index 0. A string index is valid only if the string is a name or identifier of at least one element in the document.

Remarks

This collection is indexed first by name, then by identifier. If duplicate names are found, a collection of those named items is returned. Collections of duplicate names must subsequently be referenced by ordinal position.

This collection includes A elements that have a NAME= or ID= attribute as long as they also have an HREF= attribute.

Example

The following example displays the HREF= attribute of the third link defined in the document.

alert(document.anchors(2).href);

Property

length

Methods

item, tags

Applies To

document


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.