A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/ja/docs/Web/API/HTMLSelectElement/item below:

HTMLSelectElement: item() メソッド - Web API

HTMLSelectElement: item() メソッド

Baseline Widely available

HTMLSelectElement.item() メソッドは、選択肢のリスト内で引数で渡された位置にある HTMLOptionElement に対応する Element を返します。存在しない場合は null を返します。

JavaScript では、ブラケット構文に unsigned long の値を入れた selectElt[index] の形で、selectElt.namedItem(index) と同等になります。

構文
item(index)
// or collection[index]
引数 返値 例 HTML
<form>
  <select id="myFormControl">
    <option id="o1">Opt 1</option>
    <option id="o2">Opt 2</option>
  </select>
</form>
JavaScript
// Returns the HTMLOptionElement representing #o2
elem1 = document.forms[0]["myFormControl"][1];
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4