option – list option
<option value="value">Option text</option>
One option in select or a suggestion in datalist. The visitor sees the text, the value is sent – and when it is missing, the text of the option.
- Default display:
display: block - End tag: can be omitted – the option is ended by another
option,optgroupor by the end of the list - Content: text
- Where it can be used:
select,optgroupordatalist - DOM interface:
HTMLOptionElement
Attributes
- value – the value that is sent (without it, the text of the option with whitespace collapsed).
- selected – selected at the start.
- disabled – cannot be selected.
- label – a shorter text instead of the content.
Examples
A preselected and an unavailable option:
<label for="v-size">Size</label> <select id="v-size" name="size"> <option value="500">small (500 g)</option> <option value="1000" selected>large (1 kg)</option> <option value="2000" disabled>family (2 kg) – sold out</option> </select>
Things to watch out for
- Older browsers drop tags inside an option (an icon, bold text) and keep only the text; only browsers with a fully stylable select (
appearance: base-select) display them. Do not rely on them yet. - Without
valuethe text is sent, including accented characters and spaces. For values a program processes, a shortvalueis safer.
Browser support
Baseline – widely available: works in all major browsers and has for a long time (since 2015 at the latest). Since version: Chrome 1, Firefox 1, Safari 4. As of October 2026 (MDN browser-compat-data).
Related:
select – drop-down list
optgroup – option group
datalist – suggested values