Open
Description
https://html.spec.whatwg.org/multipage/forms.html#categories
Some elements, not all of them form-associated, are categorized as labelable elements. These are elements that can be associated with a label element.
button, input (if the type attribute is not in the Hidden state), meter, output, progress, select, textarea, form-associated custom elements
It seems to me that there are some additional cases where having an element be labelable would be desirable, namely:
- Any element with
contenteditable
(these are conceptually user input fields, so it would make sense to allow them to be labeled) - A
<fieldset>
(obviously fieldsets have the<legend>
element, but for styling it may be desirable to label the fieldset with an element not nested inside the fieldset) - An element with any widget role
Obviously workarounds exist, such as aria-labeledby
, or using custom elements, but it would seem a lot simpler to just be able to use the <label>
element already present in HTML.