-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
There is no standard way to create a proper separator or dividing line within the box created using <select>
. Currently, the most common solution is to just put some hyphens or emdashes in an <option>
with the disabled
attribute set. This doesn't actually look very good at all, and is not semantically accurate.
There's already a perfectly good element for creating horizontal dividing lines in HTML: the <hr>
element. This should be allowed in the context of a <select>
element in order to create separator rows.
This would let you then create a separator using <hr>
within the <select>
, like:
<select id="devicelist">
<option value="none">None</option>
<hr/>
<option value="1903177618651917">Internal microphone</option>
</select>
In this situation, the <hr>
is interpreted as a separator row and treated as such, rather than as a selectable option (since it's not an <option>
element.
I've also filed this on the W3C spec: w3c/html#1156