Retrieves a collection of all a objects that specify the href property and all area objects in the document.
dhtml语法
[ oColl
= ]
document.links |
[ oObject = ]
document.links(iIndex) |
DHTML可能的值
oColl | Array of a objects. |
oObject | Reference to an individual item in the array of elements contained by the object. |
iIndex | Required. Integer that specifies the zero-based index of the item to be returned. |
Members Table
The following table lists the members exposed by the
links
object. Click a tab on the left to choose the type of member you want to view.
Attributes/Properties
Property | Description |
---|
length |
Sets or retrieves the number of objects in a collection. |
Methods
Method | Description |
---|
item |
Retrieves an object from the all collection or various other collections. |
nameditem |
Retrieves an object or a collection from the specified collection. |
tags |
Retrieves a collection of objects that have the specified HTML tag name. |
urns |
Retrieves a collection of all objects to which a specified behavior is attached. |
remarks
for a objects to appear in the collection, they must have a name and/or id property.
DHTML代码范例
This example shows how to display the HREF attribute of the third link defined in the document.
alert(document.links(2).href);
是否符合公共标准
This collection is defined in
World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .
Applies To