Skip to content

QuizNot attempted

Associating labels

Which give the input a reliable accessible name?

Select all that apply.

1–4 to choose, Enter to submit
Show answer & explanation

Correct answers:

  • <label for="email">Email</label><input id="email">
  • <label>Email <input></label>
  • <input aria-label="Email">
  • for/id and wrapping the input in <label> both create a real label association (announced as the name, and clicking the text focuses the input)
  • aria-label also sets the accessible name, just with no visible label.
  • Not span + placeholder: a span isn't associated with anything, and a placeholder isn't a reliable label: it disappears while typing and often has poor contrast.