<label for="email">Email</label> <input id="email">The label's for must match the input's id, not its name.
The version with for="email" with only name="email" on the input is the tempting wrong answer. for never looks at name, so the two are not linked. The <label name=...> version has no for at all, and aria-for does not exist.
Wrapping the input inside the label also works. A linked label gives the input its accessible name, which screen readers announce. Clicking the label also focuses the input, so the clickable area gets bigger.
Read more
- <label> (MDN) (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label)developer.mozilla.org