総合 インデックス

解説記事
・本「javascriptリファレンス」について
・javascriptの使い方入門

説明

  • フォームのSelectに関する情報を提供したり、Selectを操作したりするオブジェクト。
  • HTMLの「select」要素を設定した選択欄型のフォームを、JavaScriptのオブジェクトとして取り扱う。
  • Selectオブジェクトはさらにその中に、「option」要素を使って設定したフォームの選択項目を「options」配列として持っている。
  • Selectオブジェクトは、それ自体がFormオブジェクトのプロパティとなる。
構文
 
 (window.)document.formオブジェクト名.Selectオブジェクト名.プロパティ
 (window.)document.formオブジェクト名.Selectオブジェクト名.メソッド(引数)
 (window.)document.forms[インデックス].Selectオブジェクト名.プロパティ
 (window.)document.forms[インデックス].Selectオブジェクト名.メソッド(引数)
 (window.)document.formオブジェクト名.elements[インデックス].プロパティ
 (window.)document.formオブジェクト名.elements[インデックス].メソッド(引数)
 (window.)document.forms[インデックス].elements[インデックス].プロパティ
 (window.)document.forms[インデックス].elements[インデックス].メソッド(引数)
  オプション(配列)
 (window.)document.formオブジェクト名.Selectオブジェクト名.options.length
 (window.)document.forms[インデックス].Selectオブジェクト名.options.length
 (window.)document.formオブジェクト名.elements[インデックス.options.length
 (window.)document.forms[インデックス].elements[インデックスoptions.length
 (window.)document.formオブジェクト名.Selectオブジェクト名.options[インデックス].プロパティ
 (window.)document.formオブジェクト名.Selectオブジェクト名.options[インデックス].メソッド(引数)
 (window.)document.forms[インデックス].Selectオブジェクト名.options[インデックス].プロパティ
 (window.)document.forms[インデックス].Selectオブジェクト名.options[インデックス].メソッド(引数)
 (window.)document.formオブジェクト名.elements[インデックス].options[インデックス].プロパティ
 (window.)document.formオブジェクト名.elements[インデックス].options[インデックス].メソッド(引数)
 (window.)document.forms[インデックス].elements[インデックス].options[インデックス].プロパティ
 (window.)document.forms[インデックス].elements[インデックス].options[インデックス].メソッド(引数)

プロパティ
selectedIndex セレクトフォームのオプション配列の値
defaultSelected オプション配列のデフォルトで選択されている項目の値
index オプション配列のインデックスの値
selected オプション配列の選択状態
value フォームの値
length オブジェクト(配列)の数
name オブジェクト名
type フォームのタイプ
メソッド
click フォームをクリックする
toString オブジェクトを文字列で返す
blur フォームのフォーカスを移動する
valueOf オブジェクト内の値を返す
focus フォームにフォーカスを与える
toSource オブジェクト内の値を文字列で返す