Content · Web Development · HTML

HTML <option> Element: Reference and Examples

A clear, practical element reference to option. Learn when to use it, see working HTML, and avoid common mistakes.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

The <option> element is used for one choice inside a drop-down list. You will run into it while reading other people’s HTML, and it is useful to know what job it does before copying the code.

What does <option> mean?


One choice inside a drop-down list. The tag gives the browser a specific kind of content to work with. It is more helpful to choose a tag for its meaning than because of its default look.

The value sent to the server comes from the selected option’s value, not necessarily the visible label.

A working HTML example


Here is a small example you can place in an HTML page and inspect in your browser:

<label for="favorite-color">Favorite color</label>
<select id="favorite-color" name="favorite_color">
    <option value="">Choose a color</option>
    <option value="blue">Blue</option>
    <option value="green">Green</option>
</select>

Reading the example


Find the <option> part first. Notice which elements are around it and how its content or attributes are connected to those other elements.

In this example, <option> appears alongside select, optgroup, datalist. That context is often just as important as the element itself.

The browser builds its document from these relationships. Any CSS changes appearance, while interactive JavaScript behavior must be provided separately when the example includes it.

When should you use it?


Use <option> when you want to one choice inside a drop-down list. A sensible example of this on a real website is the markup shown above; it gives the browser and accessibility tools a clearer job to work with.

Common companions are select, optgroup, datalist. Check the nesting requirements before moving the element into a different location.

Try it yourself


Add a third choice, select it, and check which value the form sends.

Common Beginner Mistakes


  • An option normally belongs inside select, optgroup, or datalist, not by itself in the page.
  • Picking <option> only because it looks a certain way instead of checking what it means.
  • Forgetting to inspect the surrounding markup when an element does not behave as expected.

Key Takeaways


  • <option> helps one choice inside a drop-down list.
  • The value sent to the server comes from the selected option’s value, not necessarily the visible label.
  • Start with meaningful markup, then add styling or scripting only when the page needs it.
Share this resourceSend this page to someone who may find it useful.