Select
Description
A form element that lets users select a choice from a dropdown list.
Accessibilty Considerations
Never use a select option or placeholder as a replacement for an explicit
label. Programmatically associate labels with select elements. The
recommended method for most circumstances is to use the label element and an
explicit association using the for
and id
attributes.
Label associated with <select>
element
<form action="">
<select name="sample-input-dropdown" id="sample-input-dropdown" class="form-select">
<option selected>Select your option</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</form>