One
<option>
elements are often inserted as dividers, or worse, convoluted JavaScript solutions that emulates this behavior with generic markup and complicated CSS.
The simple, perfectly valid and accessible solution is to use the <optgroup>
element. It’s used for grouping <option>
elements in a <select>
list into sections. It’s perfectly safe to use since it’s supported across all browsers.