Why this matters
Heading elements are used for navigation and structure. Empty or meaningless headings confuse assistive technologies and negatively impact accessibility for screen reader users.
Verify that heading elements contain meaningful content. Headings are used for structure and navigation, so empty or generic headings negatively impact accessibility and usability.
Heading elements are used for navigation and structure. Empty or meaningless headings confuse assistive technologies and negatively impact accessibility for screen reader users.
Side-by-side examples engineers can pattern-match during review.
function JavaScript101() {
return (
<>
<h1>JavaScript Programming Guide</h1>
<p>An introduction to JavaScript programming and its applications.</p>
<h2>JavaScript Basics</h2>
<p>Understanding the basic concepts in JavaScript programming.</p>
<h3>Variables</h3>
<p>Explanation of what variables are and how to declare them in JavaScript.</p>
<h3 aria-hidden>Data Types</h3> // Noncompliant
<p>Overview of the different data types in JavaScript.</p>
<h3 /> // Noncompliant
<p>Understanding how to declare and use functions in JavaScript.</p>
</>
);
}function JavaScript101() {
return (
<>
<h1>JavaScript Programming Guide</h1>
<p>An introduction to JavaScript programming and its applications.</p>
<h2>JavaScript Basics</h2>
<p>Understanding the basic concepts in JavaScript programming.</p>
<h3>Variables</h3>
<p>Explanation of what variables are and how to declare them in JavaScript.</p>
<h3>Data Types</h3>
<p>Overview of the different data types in JavaScript.</p>
<h3>Functions</h3>
<p>Understanding how to declare and use functions in JavaScript.</p>
</>
);
}function JavaScript101() {
return (
<>
<h1>JavaScript Programming Guide</h1>
<p>An introduction to JavaScript programming and its applications.</p>
<h2>JavaScript Basics</h2>
<p>Understanding the basic concepts in JavaScript programming.</p>
<h3>Variables</h3>
<p>Explanation of what variables are and how to declare them in JavaScript.</p>
<h3 aria-hidden>Data Types</h3> // Noncompliant
<p>Overview of the different data types in JavaScript.</p>
<h3 /> // Noncompliant
<p>Understanding how to declare and use functions in JavaScript.</p>
</>
);
}function JavaScript101() {
return (
<>
<h1>JavaScript Programming Guide</h1>
<p>An introduction to JavaScript programming and its applications.</p>
<h2>JavaScript Basics</h2>
<p>Understanding the basic concepts in JavaScript programming.</p>
<h3>Variables</h3>
<p>Explanation of what variables are and how to declare them in JavaScript.</p>
<h3>Data Types</h3>
<p>Overview of the different data types in JavaScript.</p>
<h3>Functions</h3>
<p>Understanding how to declare and use functions in JavaScript.</p>
</>
);
}From the same buckets as this rule.