Select typeProperty
Select Object
Definition and Usage
The type property returns the form type of the drop-down list. For a drop-down list, the type is always "select-one" or "select-multiple".
Syntax
selectObject.type
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the type property
Example
Example
The following example returns the form type of the drop-down list:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example (example.com)</title>
<script>
function displayResult(){
alert(document.getElementById("mySelect").type);
}
</script>
</head>
<body>
<form>
<select id="mySelect">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
</form>
<button type="button" onclick="displayResult()">Show the type of the drop-down list</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Example (example.com)</title>
<script>
function displayResult(){
alert(document.getElementById("mySelect").type);
}
</script>
</head>
<body>
<form>
<select id="mySelect">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
</form>
<button type="button" onclick="displayResult()">Show the type of the drop-down list</button>
</body>
</html>
Try it Yourself »
Select Object Other Extensions