Defines an option of a select form field. The HTML <option> tag is used for defining option items within a list.

This element can be used in conjunction with the <select> or <##_tag-datalist_##> elements. Also see <optgroup> tag for grouping your option items.

Required Attributes

  • None.

Optional Attributes

  • selected can be used to specify that the option is initially selected. It must be used in the format selected="selected".
  • value can be used to specify a value for the option. If value is not used, the value of the option element is set to its contents by default.
  • Common attributes

Example

<select name="furniture">
	<optgroup label="Kitchen"> 
		<option>Chair</option>
		<option>Table</option>
	</optgroup>
	<optgroup label="Living"> 
		<option>Sofa</option>
		<option>TV</option>
	</optgroup>
</select>

Changes in HTML5

  • None.

Related Tags