HTML <option> Tag
The <option> tag is used in conjunction with the <select> tag and is used for defining option items within the select list.
- Example Code:
<option value ="new york">New York</option>
<option value ="london">London</option>
<option value ="sydney" selected>Sydney</option>
<option value ="auckland">Auckland</option>
Attribute Definition selected Specifies that this option will be pre-selected when the user first loads the page. value Specifies the initial value of the option item. label Specifies a label to be used as an alternative to the option item's contents. Useful if you'd prefer a shorter, more concise label. disabled Disables the input control. The button won't accept changes from the user. It also cannot receive focus and will be skipped when tabbing.
- Global Attributes:
The <option> tag also supports the Global Attributes in HTML5
- Event Attributes:
The <option> tag also supports the Event Attributes in HTML5