Skip to Main Nav Link [Snippet] <> No-Code Supply Co.
Skip to Main Nav Link
window.addEventListener("DOMContentLoaded", (event) => {
let skipLinkEle = document.getElementById("skip-link");
if (!skipLinkEle) {
return;
}
skipLinkEle.addEventListener("click keydown", function (e) {
if (e.type === "keydown" && e.which !== 13) {
return;
}
e.preventDefault();
var target = document.getElementById("main");
target.setAttribute("tabindex", "-1");
target.focus();
});
});
view raw skip-nav.js hosted with ❤ by GitHub

A function that can be used with a skip to main button in your navigation. The skip button should only be visible on focus and enables keyboard only users to jump past a lengthy nav of links directly to the main content.

Have feedback or a question related to this item? Drop us some feedback!

Curated: 
6.14.23

Similar items

Bleibtgleich

2.24.25

Form Connector Webflow App

2.24.25

Print for Figma plugin

2.24.25

Tripletta

2.24.25

Making Software

2.24.25

Memberstack

12.3.19

Instant

2.21.25

Documenso

2.21.25

Elita Genetics

2.21.25

Community Equity Offering by Clay

2.21.25

También Studio

2.20.25

Liquid Metal Paper

2.20.25

Roadway

2.20.25

Greaterthan

2.20.25

Elementor

2.20.25

System Of A Down

2.19.25

Eco

2.19.25

Zyphra

2.18.25

ImageFX

2.18.25

Midlife Engineering

2.18.25

Milhoan Design

2.18.25

Dylan Brouwer

2.17.25

Byooooob

2.16.25

Softgen

2.15.25

Loti

2.15.25

WeWeb 3.0

2.15.25
Load more

Bummer, no results

Try a different search/filter combo, or drop us some feedback if there is something missing you would love to see!

Reset filters

Subscribe for updates

Get updates on the latest curated resources and be the first to hear of new features.