page-title-present

Page has a non-empty title

automaticWCAG 2.4.2 (A)confidence: highseverity: seriousoperable

Checks that the page includes a non-empty <title> element.

Applies to. Applies to a run over a whole HTML document, one whose document element is <html>; an SVG document opened on its own is notApplicable. A run narrowed by contextSelector, or by engineOptions.fragment, is notApplicable: whether the page has a title is not a property any subtree can answer. A document shown in a frame (an <iframe> or <frame> of another page) is notApplicable too: it is no page of its own, and its frame is named by the <iframe> (iframe-name-present).

Expectation. The document has a <title> element, and document.title with whitespace collapsed is non-empty. The element is looked for anywhere in the document, not only inside <head>: a <title> the parser leaves outside <head> is still the document title in every browser. Only an HTML-namespace <title> counts; the <title> of an inline <svg> names the graphic, so a page whose only <title> is inside an <svg> is missing its title element. Whether that title describes the page is page-title-patterns' question.

Examples

pass
<html>
<head><title>Quarterly report</title></head>
<body>Hi</body>
</html>

The document has a non-empty <title>.

fail
<html>
<head></head>
<body>Hi</body>
</html>

No <title> element anywhere in the document.

View source