HTMLAllCollection: namedItem() method
Deprecated
Avoid using this feature in new projects. This feature may be a candidate for removal from web standards or browsers.>
The namedItem() method of the HTMLAllCollection interface returns the first Element in the collection whose id or name attribute matches the specified name, or null if no element matches.
Syntax
js
namedItem(name)
Parameters
name-
A string representing the value of the
idornameattribute of the element we are looking for.
Return value
The first Element in the HTMLAllCollection matching the name, or null, if there are none.
Specifications
| Specification |
|---|
| HTML> # dom-htmlallcollection-nameditem> |