DOMStringList: item() メソッド
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
item()
メソッドは、DOMStringList
からインデックスによって文字列を返します。
構文
js
item(index)
JavaScript では DOMStringList
からインデックスで項目を取得するための配列風の括弧構文も提供しています。
js
list[index];
引数
index
-
取得する文字列のインデックス。インデックスはゼロ起点です。
返値
DOMStringList
のインデックスの位置にある文字列です。指定されたインデックスが範囲外である場合は null
です。
例外
TypeError
-
引数が指定されなかった場合に発生します。
仕様書
Specification |
---|
HTML # dom-domstringlist-item |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
item |
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.