...
...
HTML <option> Tag
Definition and Usage
The <option> tag defines an option in a select list.
The <option> element goes inside the <select> element or the <datalist> element.
Example
A drop-down list with four 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
| Element | Chrome | IE | Firefox | Safari | Opera |
|---|---|---|---|---|---|
| <option> | Yes | Yes | Yes | Yes | Yes |
Attributes
| Attribute | Value | Description |
|---|---|---|
| disabled | disabled | Specifies that an option should be disabled |
| label | text | Specifies a shorter label for an option |
| selected | selected | Specifies that an option should be pre-selected when the page loads |
| value | text | Specifies the value to be sent to a server |
Global Attributes
The <option> tag also supports the Global Attributes in HTML.
Event Attributes
The <option> tag also supports the Event Attributes in HTML.
YouTip