Allowed attribute values
- Rule ID:
- attribute-allowed-values
- Category:
- Content model
- Standards:
- HTML5
Validates attributes for allowed values.
Enumerated string values are matched case insensitive while regular expressions are matched case sensitive unless /i
is used.
Use element-required-attributes to validate presence of attributes.
The requirements comes from the element metadata:
{
"input": {
"attributes": {
"type": {
"enum": ["text", "email", "..."]
}
}
}
}
Rule details
Examples of incorrect code for this rule:
<a href>...</a>
<input type="foobar">
Examples of correct code for this rule:
<a href="page.html">...</a>
<input type="text">