Select type Attribute

Definition and Usage

type The attribute returns what 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

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

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

Try It Yourself

Example 2

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

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

Try It Yourself

Syntax

selectObject.type

Technical Details

Return Value: String value, indicating that the drop-down list (<select> element) is a form element type.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support