HTML

HTMLOptGroupElement

HTMLOptGroupElement <optgroup>

Special features and methods for modifying the display and layout of <optgroup> elements are provided by the HTMLOptGroupElement interface.

Related options are grouped together in a <select> element using the <optgroup> tag (drop-down list). Groups of related options make it easier for a user to manage a long list of options.

Attribute Value Description Example
reversed reversed Specifies that the list order should be reversed (9,8,7...) <ol reversed> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol>
start number Specifies the start value of an ordered list <ol start="50"> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol>
type 1 Default. Decimal numbers (1, 2, 3, 4) <ol type="I"> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol>
a Alphabetically ordered list, lowercase (a, b, c, d)
A Alphabetically ordered list, uppercase (A, B, C, D)
i Roman numbers, lowercase (i, ii, iii, iv)
I Roman numbers, uppercase (I, II, III, IV)

Browser Compatibility

Element Chrome Edge Firefox Safari Opera
<optgroup> Yes Yes Yes Yes Yes