Use the desired element’s
id attribute value for the label’s
The engine scans label elements that have
for attributes, and checks whether the value corresponds to the
id attributes of existing elements.
When label elements are properly associated with their respective input elements, the label is spoken by screen readers when the form field receives focus. In addition, users with impaired motor control have a larger clickable area for the control to activate it.
<label for="name">Name</label> <input type="text" name="name" id="name"/>