Select type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Select


The type property returns the type of form drop-down list.

For a drop-down list this will be "select-one" or "select-multiple".

Return Value

A String, representing the type of form element the <select> element is

The following code shows how to return which type of form element a drop-down list is:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<select id="mySelect" multiple>
</select>/*ww  w . j av a 2  s. co m*/

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {
    var x = document.getElementById("mySelect").type;
    document.getElementById("demo").innerHTML = x;


Related Tutorials