Skip to content

Allow additional elements to be considered labelable #9632

Open
@dmjohnsson23

Description

@dmjohnsson23

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a11y-trackerGroup bringing to attention of a11y, or tracked by the a11y Group but not needing response.addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions