namedItem

The namedItem JS HTMLCollection returns the first element with ID or name name from the collection.

Syntax

element = collection.namedItem(name)
element = collection[name]

Parameters

name

A non-empty string.

Examples

1 · nameItem · single

2 · nameItem · multiple

3 · [ ] · single

4 · [ ] · multiple

item

length

Web Hypertext Application Technology Working Group (WHATWG)

Home Menu