Easy Tutorial
❮ Jsref Forin Jsref Getutcseconds ❯

Select type Attribute


Definition and Usage

The type attribute returns the form type of the dropdown list. For dropdown lists, the type is always "select-one" or "select-multiple".

Syntax


Browser Support

All major browsers support the type attribute.


Example

The following example returns the form type of the dropdown list:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</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()">Display the type of the dropdown list</button>

</body>
</html>

❮ Jsref Forin Jsref Getutcseconds ❯