HTMLAllCollection: namedItem() メソッド
namedItem()
は HTMLAllCollection
インターフェイスのメソッドで、コレクション内の id
または name
属性が指定した名前に一致する最初の要素 (Element
) を返します。一致する要素がなければ null
を返します。
構文
js
namedItem(name)
引数
name
-
探している要素の
id
またはname
属性の値を表す文字列。
返値
HTMLAllCollection
で最初に name
に一致する要素 (Element
)、ない場合は null
。
仕様書
Specification |
---|
HTML # dom-htmlallcollection-nameditem |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
namedItem |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.