HTML <select> Tag

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 3 Examples
HTML Forms

What You’ll Learn

The <select> tag creates dropdown menus in HTML forms. This guide covers syntax, option elements, attributes, labels, multiple selection, accessibility, and best practices for beginners.

01

Dropdowns

Pick from a list.

02

option

List choices.

03

name

Form submission.

04

multiple

Multi-select.

05

Labels

Accessible forms.

06

Best Practices

Clear options.

What Is the <select> Tag?

The <select> tag is an HTML form element that allows users to choose one or more options from a predefined list. It is commonly used to create dropdown menus, providing a user-friendly way to select values in forms.

Valid HTML5 — Form Control

Pair select with option children. Use a label so users and screen readers know what the dropdown is for.

Each option represents one choice. The value attribute is sent when the form is submitted; the text between the tags is what users see.

📝 Syntax

Wrap option elements inside a select element:

syntax.html
<select>
  <option value="option1">Option 1</option>
  <option value="option2">Option 2</option>
  <!-- Add more options as needed -->
</select>

Labeled Dropdown Syntax

labeled-select.html
<label for="country">Country:</label>
<select id="country" name="country">
  <option value="us">United States</option>
  <option value="uk">United Kingdom</option>
</select>

Syntax Rules

  • Always set a meaningful value on each option for form submission.
  • Use name on select so the chosen value is included in form data.
  • Associate a label with for matching the select’s id.
  • Use selected on an option to pre-select the default choice.

⚡ Quick Reference

TopicCode SnippetNotes
Basic dropdown<select><option>...</option></select>Single choice
Form field namename="fruit"On select
Option valuevalue="apple"Submitted data
Multiple selectmultipleHold Ctrl/Cmd
Visible rowssize="3"List box style
Default choiceselectedOn option

⚖️ <select> vs <datalist>

Featureselectdatalist
Input typeNative dropdownSuggestions on text input
Free textNo — must pick a listed optionYes — user can type anything
ValidationBrowser enforces optionsServer-side recommended
Best forCountry, size, category pickersAutocomplete with flexible input

🧰 Attributes

The <select> tag supports attributes to customize behavior and appearance in forms:

attributes.html
<select name="example" multiple size="3">
  <option value="option1">Option 1</option>
  <option value="option2">Option 2</option>
  <option value="option3">Option 3</option>
</select>
name Forms

Identifies the field when the form is submitted.

name="country"
multiple Selection

Allows users to select more than one option.

multiple
size Display

Number of visible options when expanded or in list-box mode.

size="3"
required Validation

User must select a value before the form can be submitted.

required
disabled State

Prevents interaction. Use on select or individual options.

disabled
selected On option

Marks the default selected option on page load.

<option selected>

Examples Gallery

Build dropdown lists and multi-select controls with select and option elements.

👀 Live Preview

A simple fruit dropdown with a label:

📚 Common Use Cases

Use <select> when users must pick from a fixed list of predefined options.

Basic Dropdown

Create a simple dropdown with the select tag and option elements:

basic-dropdown.html
<label for="fruit">Choose a fruit:</label>
<select id="fruit" name="fruit">
  <option value="apple">Apple</option>
  <option value="banana">Banana</option>
  <option value="orange">Orange</option>
</select>
Try It Yourself

Multiple Selection

Allow users to select multiple options by adding the multiple attribute. Pair with size for a clearer list-box UI:

multiple-selection.html
<label for="colors">Choose colors:</label>
<select id="colors" name="colors" multiple size="4">
  <option value="red">Red</option>
  <option value="green">Green</option>
  <option value="blue">Blue</option>
</select>
Try It Yourself

♿ Accessibility

  • Always use a label — Connect label for to the select’s id so screen readers announce the field purpose.
  • Meaningful option text — Write clear, concise labels users can understand at a glance.
  • Group related options — Use optgroup with a label attribute for long categorized lists.
  • Do not rely on color alone — Disabled options should also be marked with disabled, not just styled differently.

🧠 How <select> Works

1

Browser renders dropdown

select displays options from child option elements.

Render
2

User picks a value

Click or keyboard navigation selects one or more option values.

Interact
3

Form submits data

The name and selected value are sent to the server.

Submit
=

Intuitive form input

Users pick from a controlled list, making data collection predictable and easy.

Browser Support

The <select> tag is supported in all major browsers, including Internet Explorer.

Baseline · HTML4 / HTML5

Dropdowns everywhere

All browsers support <select> with multiple, size, and disabled options.

100% Core tag support
Google Chrome Fully supported
Full support
Mozilla Firefox Fully supported
Full support
Apple Safari Fully supported
Full support
Microsoft Edge Fully supported
Full support
Internet Explorer Fully supported · EOL
Full support
Opera Fully supported
Full support
<select> tag 100% supported

Bottom line: Use <select> confidently for dropdowns in any browser.

Conclusion

Understanding the <select> tag is crucial for creating interactive and user-friendly forms on your website. By mastering its usage and attributes, you can enhance the overall user experience and make data submission more intuitive.

💡 Best Practices

✅ Do

  • Provide clear and concise labels for each option
  • Associate every select with a visible label
  • Use size with multiple for better usability
  • Test your dropdown across different browsers

❌ Don’t

  • Skip the name attribute on form selects
  • Use vague option text like “Option 1” in production
  • Rely on datalist when choices must be strict
  • Forget disabled for unavailable choices

Key Takeaways

Knowledge Unlocked

Six truths every developer should know about <select>

Bookmark these before you build your next form.

6
Core concepts
02

option

Each choice.

Children
📝 03

name

Form field.

Attributes
04

multiple

Multi-pick.

Selection
05

Labels

Accessible.

A11y
🌐 06

100% Support

All browsers.

Compatibility

❓ Frequently Asked Questions

It creates a dropdown list for users to choose one or more predefined options in a form.
select restricts choices to listed options. datalist suggests options but allows free text.
Add the multiple attribute. Use size to show several rows for easier selection.
The name identifies the field when the form is submitted so the server receives the selected value.
Yes. Full support in every major browser including Internet Explorer.

Build dropdown forms

Practice <select> with basic dropdowns, multiple, and form attributes in the Try It editor.

Try basic dropdown →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful