A drop-down list form element.
The HTML <select> tag is used for defining a select list.
This element is used in conjunction with the <option> element to produce a list of options that the user can choose from.
Also see <optgroup> element for grouping your option items.
Required Attributes
Optional Attributes
- name can be used so that the value of the selected option element can be processed.
- size can be used to specify how many items of the list are displayed at any time. The default is 1.
- multiple can be used to specify that more than one item from the list can be selected. This must be used in the format multiple="multiple".
- disabled can be used to disable an element. It must be used in the format disabled="disabled".
- tabindex can be used to specify where the element appears in the tab order of the page.
- Common attributes
Example
<select name="furniture">
<optgroup label="Kitchen">
<option>Chair</option>
<option>Table</option>
</optgroup>
<optgroup label="Living">
<option>Sofa</option>
<option>TV</option>
</optgroup>
</select>
Changes in HTML5
Related Tags