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

Accessible Accordion for Webflow

4.19.25

Zite

4.19.25

shopdev

4.19.25

Magic Animator

4.19.25

GRAPHICHUNTERS®

4.19.25
Featured
Preview

Osmo

View item

Distributional

4.17.25

Golden Canon Grid Course for Web Designers — BONT®

Free
4.16.25

RIVR

4.15.25

Stack Asset Management

4.14.25

Stereotype

4.14.25

OH Architecture

4.9.25

Nory

4.9.25

Greer Mosher

4.8.25

Osmo

€25/mo
4.5.25

Greenhouse

4.5.25

Heritage In Art

4.5.25

Mast

3.13.23

Whalesync

1.8.23

Marga Navarro

4.2.25

Jetboost

12.3.19

Granola

3.30.25

Giga Energy

3.30.25

Fathom Analytics

12.1.22

Audienceful

8.1.22

Also

3.26.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.