OAA HEADING_3: H1 element content should not come only from the alt text of an image.

Rulesets

WCAG 2.0 Requirement 2.4.2 Page Titled
Status: Accepted
Severity: Recommendation
Priority: Priority 1
IITAA 1.0 1.3 Provide meaningful page titles.
Type:
Severity: Violation
Priority: Priority 1
Status: Accepted

Markup References

Validation Code

Message

The text content of an h1 element should not come solely from the alt attribute of img elements.

Dependencies

None

Context

h1

Parameters

None

Code

function (ruleContext) {
  var h1Text = util.getNodeTextRecursively(ruleContext);
  var passed = h1Text != util.getDisplayableAlt(ruleContext);
  return new ValidationResult(passed, [ruleContext], '', '', []);
} // endfunction