Skip to content

Better documentation for labelling inputs #37665

@wbamberg

Description

@wbamberg

The discussion at https://github.com/orgs/mdn/discussions/763 proposed changing example code on MDN from "explicit labels" (in which input elements are associated with labels using for and id attributes) to "implicit labels" (in which the association is defined by nesting the input inside the label).

Discussion suggests that we don't want to do this, mainly because (according to https://css-tricks.com/html-inputs-and-labels-a-love-story/): "an implicit label is not handled correctly by all assistive technologies".

However we don't document this in the reference page for <label>: we do describe both forms but don't give any guidance about which to use. We ought to do this.

I'd love to know more concrete details about the implications of this choice for assistive technologies and wonder if @scottaohara or @ericwbailey might be able to help with this <3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:HTMLHypertext Markup Language docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions