HTML DOM Document links
HTML DOM Document links Property
The links property is used to return collection of all links in the current document. It is a read-only property and returns HTMLCollection. Elements in a collection can be accessed by index that starts at 0. Its length Property returns the number of elements in the collection.
Syntax:-
Its syntax is:- document.links
Return:-
Its return is:- All a and area elements in the document
Further Explanation:-
Method | Description |
[index] | Returns element with the specified index. |
item(index) | Returns element with the specified index. |
namedItem(id) | Returns element with the specified id. |
Properties are:-
Property | Description |
length | The number of a and area elements in the collection. |