Latest web development tutorials

HTML DOM Select type property

Select Object Reference Select Objects

Definition and Usage

type property returns the type drop-down form. For the drop-down list, type is always "select-one" or "select-multiple".

grammar

selectObject.type


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute type


Examples

Examples

The following example returns the form type drop-down list:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.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 ()"> Display type drop-down list </ button>

</ Body>
</ Html>

try it"


Select Object Reference Select Objects