You are here: Reference > JavaScript > client-side > HTML DOM > properties > type (keygen, select)

type property (keygen, select)

Browser support:
Returns a string that identifies whether more than one item can be selected in a selection list.
The selection type can be modified by the multiple property.


You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

String that represents the type of the selection list.
One of the following values:
Multiple selection is disabled. The multiple property is set to false.
Multiple selection is enabled. The multiple property is set to true.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the type property:
    <script type="text/javascript">
        function GetSelType () {
            var selectObj = document.getElementById ("mySelect");
            alert (selectObj.type);

        function ToggleSelType () {
            var selectObj = document.getElementById ("mySelect");
            selectObj.multiple = !selectObj.multiple;
    <select multiple="multiple" id="mySelect">
        <option selected="selected">Peach</option>

    <br />
    <button onclick="GetSelType ();">Get the selection type!</button>
    <br />
    <button onclick="ToggleSelType ();">Toggle the selection type!</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content