2.4.4 namedItem

Retrieves an object or a collection from a specified collection. The namedItem method first searches for an object with a matching id attribute. If a match is not found, the method searches for an object with a matching name attribute, but only on those elements that are allowed a name attribute.

The namedItem method extends the following interfaces:

All Document Modes (Internet Explorer 8) The namedItem method does not return collections if more than one named item is found; instead, it returns the first case-insensitive matched element.

Parameters

sName of type DOMString

Specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.

Return Value

Returns an object or a collection of objects if successful, or null otherwise.

No JScript Error