HTML:
<select id="mySelect">
<option>Apple</option>
<option>Orange</option>
<option>Pineapple</option>
<option>Banana</option>
</select>
Javascript:
var x=document.getElementById("mySelect");
alert(x.options.item(1).text);
alert(x.options[1].text);
ここでは、オプションのテキストを取得しています。違いは何ですか
x.options.item(1).text
と
x.options[1].text
どちらも同じ結果が得られるためです。