HTML <option> Tag

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 2 Examples
HTML5 Forms

What You’ll Learn

The <option> tag defines individual choices in dropdown menus. This guide covers syntax, key attributes, common form patterns, and how option works with select and optgroup.

01

Dropdown Items

One choice per option.

02

Inside select

Child of select or optgroup.

03

value Attribute

Data sent on form submit.

04

selected

Default pre-selected item.

05

disabled

Block unavailable choices.

06

Accessible Forms

Label select, clear options.

What Is the <option> Tag?

The <option> tag is an essential HTML element used within the <select> element to define individual options in a dropdown menu. It allows users to choose from a list of predefined values when filling out a form.

Valid HTML5 — Selectable Form Choice

Each <option> represents one item in the menu. The text between tags is what users see; the value attribute is what the server receives on submit.

Options can also appear inside <optgroup> for categorized menus, or inside <datalist> to suggest values for text inputs.

📝 Syntax

Place <option> inside <select>. Each option represents a single dropdown item:

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

Syntax Rules

  • Parent must be select, optgroup (inside select), or datalist.
  • Use value for the submitted data; visible text is the element content.
  • Only one option should have selected in a single-select menu.
  • Self-closing <option> is valid when there is no inner text.

⚡ Quick Reference

TopicCode SnippetNotes
Basic option<option value="us">USA</option>Visible + submitted
Default choiceselectedPre-selected on load
UnavailabledisabledCannot be picked
Placeholdervalue="" disabled selectedPrompt before choice
In optgroupInside optgroupGrouped category
Browser supportUniversalAll major browsers

⚖️ <option> vs <select>

ElementRoleAnalogy
<select>Dropdown containerThe menu box
<option>Individual choiceEach menu item
<optgroup>Labeled sectionCategory header

🧰 Attributes

The <option> tag supports attributes to customize appearance and behavior:

attributes.html
<select>
  <option value="option1" selected>Default Option</option>
  <option value="option2" disabled>Disabled Option</option>
</select>
value Submit

Value sent to the server when the form is submitted.

value="option1"
selected Default

Marks the option pre-selected when the page loads.

selected
disabled State

Makes the option unselectable in the dropdown.

disabled
label Display

Alternative visible label (used in optgroup context or when content is empty).

label="Display text"

Examples Gallery

Build basic dropdowns and control default and disabled options in HTML forms.

👀 Live Preview

Simple select with two options:

📚 Common Use Cases

The <option> tag creates dropdown menus with selectable choices and supports selected and disabled for default and unavailable items.

Basic Dropdown

The primary use of option is to create a dropdown menu with selectable choices.

basic-dropdown.html
<select>
  <option value="option1">Option 1</option>
  <option value="option2">Option 2</option>
</select>
Try It Yourself

Default and Disabled Options

Use selected and disabled attributes to set the default choice and block unavailable options.

default-and-disabled-options.html
<select>
  <option value="option1" selected>Default Option</option>
  <option value="option2" disabled>Disabled Option</option>
</select>
Try It Yourself

♿ Accessibility

  • Label the select — Associate <label for="id"> with the parent select, not individual options.
  • Meaningful option text — Write clear labels users can understand without context.
  • Don’t rely on value alone — Visible text should describe the choice; use value for server codes.
  • Placeholder pattern — Use disabled selected on a prompt option so users must pick actively.

🧠 How <option> Works

1

Author adds options

Define choices inside select with value attributes.

Markup
2

User opens dropdown

Browser lists all non-disabled options for selection.

Interaction
3

Form submits value

Selected option’s value is sent with the form data.

Submit
=

Structured user input

Dropdowns collect consistent, validated choices from predefined options.

Browser Support

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

Baseline · HTML4 / HTML5

Universal option support

Every browser renders <option> inside select menus with full attribute support.

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
<option> tag 100% supported

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

Conclusion

Mastering the <option> tag is essential for creating interactive and user-friendly dropdown menus in HTML forms. By leveraging its attributes and best practices, you can enhance the overall functionality of your web forms.

💡 Best Practices

✅ Do

  • Nest every option inside select
  • Use value for submitted form data
  • Keep dropdown lists concise and organized
  • Label the parent select element

❌ Don’t

  • Place option outside select or datalist
  • Mark multiple options selected (single select)
  • Use cryptic values without clear visible text
  • Skip value when server needs specific codes

Key Takeaways

Knowledge Unlocked

Six truths every developer should know about <option>

Bookmark these before you build form dropdowns.

6
Core concepts
📂 02

Inside select

Child of select or optgroup.

Structure
⚙️ 03

value

Submitted form data.

Attributes
04

selected

Default pre-selected item.

Default
🚫 05

disabled

Block unavailable choices.

State
🌐 06

100% Support

All major browsers.

Compatibility

❓ Frequently Asked Questions

It defines individual choices inside a select dropdown or datalist.
Users see the text content; the server receives the value attribute on submit.
It marks the option shown as the default when the page loads.
Only inside select, optgroup, or datalist.
Use <option value="" disabled selected>Choose...</option> as the first item.

Build Interactive Dropdowns

Practice <option> with selected and disabled in the Try It editor.

Try selected & disabled →

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