Heading Navigation
Heading Navigation cycles through authored heading contexts that contain tabbable content and focuses each context's first tabbable element. Focus stays on an existing page target rather than moving to a generated heading target.
How to Use Heading Navigation
First, initialize OpenKeyNav on the page.
const openKeyNav = new OpenKeyNav();
openKeyNav.init();
Press H to move to the first tabbable element in the next eligible heading context. Press Shift + H to move backward. The sequence includes native <h1> through <h6> elements and ARIA headings with a valid aria-level, skips headings without tabbable content, and wraps at either end.
Navigate Through Specific Heading Levels
Press 1, 2, 3, 4, 5, or 6 to move to the next eligible context at the corresponding authored heading level. Hold Shift with the number to move backward.
Each level command continues from the current authored heading's document position, even when the current heading has a different level, and wraps at the end. OpenKeyNav focuses the matching context's first tabbable element. If Structural Navigation is active, the heading command keeps that mode active and synchronizes its authored heading context with the new focus target.
Turn OpenKeyNav on
After the page loads, press Shift + O to turn OpenKeyNav on or off. OpenKeyNav keeps its character commands inactive until a user enables them. This persistent on/off mechanism supports the turn-off option in WCAG 2.1 Success Criterion 2.1.4: Character Key Shortcuts.