selectオブジェクト

Atlas PR2から追加された機能です。
セレクトメニューの項目をあとから変更できます。

◆スクリプト

function hills(form)
{
  form.list.options[0].text = "ブランドン"
  form.list.options[1].text = "ブレンダ"
  form.list.options[2].text = "ディラン"
}
function tng(form)
{
  form.list.options[0].text = "ピカード"
  form.list.options[1].text = "データ"
  form.list.options[2].text = "Q"
}

◆フォーム

<FORM><SELECT name="list"><OPTION>Item 0
<OPTION>Item 1
<OPTION>Item 2
</SELECT><INPUT TYPE="button" VALUE="90210" onClick="hills(this.form)"><INPUT TYPE="button" VALUE="TNG" onClick="tng(this.form)"></FORM>

◆実行結果