What are HTML Select Elements?
An HTML <select>
element creates a dropdown list, allowing users to select one or more options from a predefined list. It is commonly used in forms for user input.
Sample HTML for a simple dropdown:
<form>
<label for="color">Choose a color:</label>
<select id="color" name="color">
<option value="red">Red</option>
<option value="yellow">Yellow</option>
<option value="blue">Blue</option>
</select>
</form>
Why Select Element Labels Matter
Labels for <select>
elements are crucial for usability, accessibility, and clarity. They help users understand the purpose of the dropdown, making forms easier to navigate and interact with.
They ensure that assistive technologies, such as screen readers, can correctly announce the purpose of the dropdown to users with visual or cognitive impairments.
Best Practices
Each
select
element should have only one label.All
id
elements on a page should be unique to minimize user confusion.Ensure label text is concise, descriptive, and makes sense when read aloud to a screen reader user.
Test your forms with screen readers to confirm proper label functionality.
Refer to our article Form Element Label Issues: Correcting for tips on correcting form labeling issues.
Resources
The HTML Select element from mdn web docs
Labeling Controls - part of W3C Forms Tutorial
Learn More with WCAG
DubBot Flag: Select element must have an accessible name, Ensures select element has an accessible name
If you have questions, please contact our DubBot Support team via email at help@dubbot.com or via the blue chat bubble in the lower right corner of your screen. We are here to help!