Pattern: Unassociated form label
Issue: -
Form labels must be associated with their controls either through nesting or using the htmlFor attribute. Unassociated labels prevent screen reader users from understanding the purpose of form controls.
Example of incorrect code:
<label>Name</label>
<input type="text" />
<label>Email</label>
<CustomInput />
Example of correct code:
<label htmlFor="name">Name</label>
<input id="name" type="text" />
<label>
Email
<input type="email" />
</label>