Select type Attribute

Definition and Usage

type The attribute returns which type of form element the dropdown list is.

For the dropdown list, the return value will be "select-one" or "select-multiple".

See also:

HTML Reference Manual:HTML <select>-Tag

Instance

Example 1

Which type of form element does the dropdown list belong to?

var x = document.getElementById("mySelect").type;

Versuchen Sie es selbst

Example 2

Which type of form element is the dropdown list that allows multiple selections?

var x = document.getElementById("mySelect").type;

Versuchen Sie es selbst

Syntax

selectObject.type

Technische Details

Rückgabewert: Zeichenfolgenwert, der angibt, dass das Dropdown-Liste (<select>-Element) eine Formularelement-Typ ist.

Browser-Unterstützung

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Unterstützung Unterstützung Unterstützung Unterstützung Unterstützung