No missing references
- Rule ID:
- no-missing-references
- Category:
- Document
- Standards:
- HTML5
Require all elements referenced by attributes such as for to exist in the current document.
Checked attributes:
label[for]input[list]*[aria-activedescendant]*[aria-controls]*[aria-describedby]*[aria-details]*[aria-errormessage]*[aria-flowto]*[aria-labelledby]*[aria-owns]
A current limitation is that only the <title> and <desc> elements from an SVG can be referenced.
Rule details
Examples of incorrect code for this rule:
<label for="missing-input"></label>
<div aria-labelledby="missing-text"></div>
<div aria-describedby="missing-text another-missing"></div>
Examples of correct code for this rule:
<label for="my-input"></label>
<div id="verbose-text"></div>
<div id="another-text"></div>
<div aria-labelledby="verbose-text"></div>
<div aria-describedby="verbose-text another-text"></div>
<input id="my-input">
Version history
- 6.6.0 - Handle SVG
<title>and<desc> - 5.5.0 - Extended list of checked aria attributes.