HTML <select>Tag


Example

Create a selection list with 4 options:

<select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the <select> tag.


Tag Definition and Usage Instructions

The <select> element is used to create a drop-down list.

Inside the <select> element, the<option>tag defines the available options in the list.


Tips and Notes

Tip:The <select> element is a form control that can be used to accept user input in a form.


Differences Between HTML 4.01 and HTML5

HTML5 added some new attributes.


Attributes

New: New attribute in HTML5.

Attribute Value Description
autofocusNew autofocus Specifies that the drop-down list automatically gets focus when the page loads.
disabled disabled When this attribute is true, the drop-down list is disabled.
formNew form_id Defines one or more forms to which the select field belongs.
multiple multiple When this attribute is true, multiple options can be selected.
name text Defines the name of the drop-down list.
requiredNew required Specifies that the user must select an option in the drop-down list before submitting the form.
size number Specifies the number of visible options in the drop-down list.


Global Attributes

The <select> tag supportsHTML Global Attributes。


Event Attributes

The <select> tag supportsHTML Event Attributes。


Related Articles

HTML DOM Reference:Select Object

Other Extensions