<option>: The OPTION Element
Last updated: 2026-10-13
<option>The OPTION Element
A single selectable item inside select, datalist or optgroup.
| Category | Forms |
|---|---|
| Content Model | Flow content |
| Allowed Parents | Any element that accepts flow content |
| Content Tag | Yes — requires closing </option> tag |
| Status | Standard |
📝 Syntax
<option value="apple">Apple</option>
⚙️ Attributes
This element supports the global attributes plus the following:
| Attribute | Value | Description |
|---|---|---|
value | Value sent to the server (falls back to text if omitted). | |
selected | Pre-select this option. | |
disabled | Disables this option. | |
label | Alternative display text. |
▶ Example
Edit the code below and see the live result in the playground:
🌐 Browser Support
| Browser | |||||
|---|---|---|---|---|---|
| <option> | ✓ v1 | ✓ v12 | ✓ v1 | ✓ v1 | ✓ v1 |
| Supported in all major browsers | |||||
Tip: Without value, the text content between the tags is submitted.
❓ FAQ
QHow do option value and its display text relate?
AWith a value attribute, the value gets submitted and the text between the tags is display-only; without one, the display text itself is submitted. Best practice is to always set value (e.g.
<option value='bj'>Beijing</option>) so the backend never depends on display copy that may change.QCan an option be disabled?
AYes —
<option disabled> makes the option unselectable (shown grayed out). Typical uses: a placeholder row like Please choose, or delisted products. A whole optgroup can be disabled too.QCan option contain HTML?
AEssentially no — the native option renders plain text only (some browsers tolerate minimal markup, but it is unreliable). Rich dropdowns with icons or two-line text need custom components or third-party libraries, with accessibility attributes preserved.
🏷️ Related Tags
💡 Related Cases
More case studies coming soon — check back later.