scriptsNN n/a IE 4 DOM n/a  

  

A collection of all scripts defined or imported in a document, including those defined in the head or body portion. Collection members are sorted in source code order.

 
Object Model Reference
 
document.scripts
 
Object-Specific Properties
 
length
 
Object-Specific Methods
 
item( )namedItem( )tags( )urns( )
 
Object-Specific Event Handler Properties

None.

lengthNN n/a IE 4 DOM n/a  

Read-only  

Returns the number of elements in the collection.

 
Example
 
var howMany = document.scripts.length;
 
Value

Integer.

item( )NN n/a IE 4 DOM n/a  

item(index[, subindex])

  

Returns a single object or collection of objects corresponding to the element matching the index value (or, optionally, the index and subindex values).

 
Parameters
 
  • When the parameter is a zero-based integer, the returned value is a single element corresponding to the said numbered item in source code order (nested within the current element). When the parameter is a string, the returned value is a collection of elements with id properties that match that string.
  • If you specify a string value for the first parameter, you may use the second parameter to specify a zero-based integer to retrieve a specific element from the collection with id properties that match the first parameter's string value.
 
Returned Value

One object or collection (array) of objects. If there are no matches to the parameters, the returned value is null.

namedItem( )NN n/a IE 6 DOM n/a  

namedItem("ID")

  

Returns a single script object or collection of script objects corresponding to the element matching the parameter string value.

 
Parameters
 
  • The string that contains the same value as the desired element's id attribute.
 
Returned Value

One script object or collection (array) of script objects. If there are no matches to the parameters, the returned value is null.

tags( )NN n/a IE 4 DOM n/a  

tags(tagName)

  

Returns a collection of objects (among all objects within the current collection) with tags that match the tagName parameter. Redundant here, because all elements have the same script tag.

 
Parameters
 
  • A string of the all-uppercase version of the element tag, as in document.scripts.tags("script").
 
Returned Value

A collection (array) of objects. If there are no matches to the parameters, the returned value is an array of zero length.

urns( )NN n/a IE 5(Win) DOM n/a  

urns(URN)

  

See the all.urns( ) method.