Reputation: 2045
The W3C Specification for the label tag http://www.w3.org/TR/html401/interact/forms.html#h-17.9.1 says:
The LABEL element may be used to attach information to controls
Does "information" include error messages?
Upvotes: 4
Views: 343
Reputation: 20343
You can use it, as it is possible to attach more labels to a single input.
It also have accessibility considerations. This article recommends the following (mind the role
attribute):
<label for="userEmail" role="alert">That email address is invalid.</label>
Upvotes: 5