Require attribute to be used in correct context (attribute-misuse
)
Some attributes have usage requirements, for instance:
<a target>
requires thehref
attribute.<button formaction>
requirestype="submit"
.<meta content>
requires one of thename
,http-equiv
oritemprop
attributes.<meta>
can only contain one of thename
,http-equiv
oritemprop
attributes.<meta name>
requires thecontent
attribute.
Rule details
Examples of incorrect code for this rule:
<a target="_blank">
<button type="button" formaction="post">
<meta name=".." http-equiv="..">
Examples of correct code for this rule:
<a href=".." target="_blank">
<button type="submit" formaction="post">
<meta name=".." content="..">
<meta http-equiv=".." content="..">
Version history
- 7.7.0 - Rule added.