HomeReferencesHTML Tags

HTML Tag: optgroup

Option group. Defines a group of option elements in a select form field.

HTML Dog, The Book HTML Dog book cover

HTML Dog is hosted by Titan Internet

Required Attributes

  • label is used to assign a label to the option group.

Optional Attributes

  • disabled can be used to disable an element. It must be used in the format disabled="disabled".
  • Common attributes

Example


<select name="catsndogs">
	<optgroup label="Cats">
		<option>Tiger</option>
		<option>Leopard</option>
		<option>Lynx</option>
	</optgroup>
	<optgroup label="Dogs">
		<option>Grey Wolf</option>
		<option>Red Fox</option>
		<option>Fennec</option>
	</optgroup>
</select>