Volvo "> Volvo " />
Easy Tutorial
❮ Att Td Charoff Tag Address ❯

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>

Browser Support

All major browsers support the <select> tag.


Tag Definition and Usage

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

The <option> tag within the <select> element 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 introduced some new attributes.


Attributes

Attribute Value Description
autofocus New autofocus Specifies that the drop-down list should automatically get focus when the page loads.
disabled disabled Disables the drop-down list when set to true.
form New form_id Defines one or more forms the select field belongs to.
multiple multiple Allows multiple options to be selected when set to true.
name text Defines the name of the drop-down list.
required New required Specifies that the user must select an option from 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 supports HTML's global attributes.


Event Attributes

The <select> tag supports HTML's event attributes.


Related Articles

HTML DOM Reference: Select Object

❮ Att Td Charoff Tag Address ❯