HTML4 HTML5
Used to define a single choice option inside a drop-down list (<select>), option group (<optgroup>), or datalist suggestion list (<datalist>)[cite: 3].
Both opening and closing tags are mandatory[cite: 3].
Attributes:
value – value sent to the server upon form submission (if not provided, text inside the tag is sent)[cite: 3].selected – indicates that this option is selected by default after page load[cite: 3].disabled – disables user selection for this option[cite: 3].label – optional text representing the option (used e.g., in suggestions)[cite: 3].class, id, and style are also used[cite: 3].Code:
The browser will interpret this code as follows: