HTML DOM Document scripts
HTML DOM Document scripts Property
The scripts property is used to return the collection of all script elements in the 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.scripts
Return:-
Its return is:- All script 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 script elements in the collection. |