HTMLSelectElement: type プロパティ
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.
HTMLSelectElement.type
は読み取り専用のプロパティで、フォームコントロールの type
を返します。
値
次のうちのいずれかです。
"select-multiple"
複数の値が選択可能な場合"select-one"
一つの値だけが選択可能な場合
例
js
switch (select.type) {
case "select-multiple":
// 複数の値が選択可能
break;
case "select-one":
// 一つの値だけが選択可能
break;
default:
// 標準外の値(または SELECT 要素ではない)
}
仕様書
Specification |
---|
HTML # dom-select-type-dev |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
type |
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.
関連情報
- このインターフェイスを実装している HTML の
<select>
要素。