DEV Community

Cover image for Show active navigation link in JavaScript
coder4life
coder4life

Posted on

Show active navigation link in JavaScript

Two options to show the active nav link: first with an active class or second with the aria-current="page" attribute. We have a simple navigation consisting of 3 links and 3 seperate HTML pages. Some basic CSS styling with a hover action that changes the color or the link. We will use the same hover styling for the active nav link.

Top comments (0)