The <select> element creates a menu of options — usually a dropdown, or a scrolling list box when multiple or size greater than 1 is set.
Nest <option> (and optional <optgroup>) children. Give the control a name for form data, and pair it with a <label> for accessibility. Prefer <datalist> when users may still type free text.
Baseline · Widely available.
Not deprecated. Core select support has been stable across browsers since about July 2015 (and much earlier in practice).
Experimental extras.
Fully customizable selects (e.g. <button> / <selectedcontent> patterns) are newer and have limited support — learn classic <select> + <option> first.
Syntax
HTML Syntax
syntax.html
<select name="field">…options…</select>
Both start and end tags are required. Put options (and optional groups or <hr> separators) inside the select.
Reference
Attributes
Element-specific attributes on <select> (plus globals):
multiple turns the control into a multi-select list box.
size="4" shows four visible rows (users can scroll for more).
Tell users how to multi-select in the label text.
disabled on an option blocks that choice (here, Hamster).
Edge Cases & Pitfalls
Most mistakes skip labels, misuse placeholders, or surprise users with multi-select.
a11y
Always provide a visible label
Placeholder text inside the first option is not a substitute for <label>. Screen readers need a real association.
required
Placeholder must use empty value
For a single-select dropdown, the placeholder is the first direct <option value=""> child. Other empty-value options count as real choices.
multiple
Explain multi-select UX
Keyboard and pointer gestures vary by OS. Tell users they can pick more than one option, especially when the control looks like a dropdown.
vs datalist
Closed list vs suggestions
Use <select> when only listed values are valid. Use <datalist> when free text is still allowed.
styling
Native look is hard to restyle
Browsers limit how far you can restyle the closed and open states. Prefer native controls for reliability unless you need a fully custom widget.
Compatibility
Browser Support
The <select> element is a core HTML form control in every major browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<select>
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera all support select, option, optgroup, multiple, and size. Some advanced customization features vary by browser.
98%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet ExplorerAll
Supported
<select>Widely supported
Bottom line: Safe to use everywhere for option menus. Label every select, and test multiple-select UX on keyboard and touch.
Remember
Key Takeaways
Role:<select> presents a fixed menu of options for forms.
Children: use <option>, optional <optgroup>, and a matching <label>.
multiple / size: multi-select and visible row count change the control into a list box.
vs datalist: closed choices → select; suggestions + free text → datalist.
One line: label the control, nest options (and groups), and set name for the submitted value.
UA style
Default CSS Settings
Browsers render select as an inline-block form control with platform chrome. A simplified idea:
default.css
select {
display: inline-block;
font: inherit;
}
Exact arrows, borders, and open-menu styling are browser- and OS-specific.
Frequently Asked Questions
The select element creates a menu of options — usually a dropdown, or a scrolling list box when multiple or size greater than 1 is set. Users pick one or more choices to submit with a form.
Yes for accessibility. Associate a label with for matching the select’s id (or wrap the select inside the label) so assistive technology can announce the control’s purpose.
select limits the user to the listed options. datalist suggests values for an input but still allows free text.
Add the multiple attribute. Tell users how to multi-select (for example Ctrl/Command+click on desktop). Multiple values are submitted as repeated name=value pairs.
size sets how many option rows are visible. Default is 1 (dropdown) unless multiple is set, which defaults size to 4 and usually shows a list box.
Without multiple and without size greater than 1, the implicit role is combobox. Otherwise it is listbox.