<option> Tag in HTML

The <option> tag is used to define options in a drop-down list created using the <select> tag. Each <option> represents a single option that the user can choose from in the drop-down.

Key Points on <option> Tag:

Syntax of <option> Tag:

Syntax Example

<select>
            <option value="1">Option 1</option>
            <option value="2">Option 2</option>
        </select>

Example of <option> Tag in HTML:

This example demonstrates how the <option> tag is used within a <select> tag to create a drop-down list.

Code Example


        <select>
            <option value="volvo">Volvo</option>
            <option value="saab">Saab</option>
            <option value="mercedes">Mercedes</option>
            <option value="audi">Audi</option>
        </select>
                

Output

The <option> tag is a key part of creating interactive forms in HTML, allowing users to select from a list of options. It is used in combination with the <select> tag to create a drop-down menu, and it supports attributes like value, selected, and disabled for better control over user interactions.