This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Active Link | |
let currentPageURL = window.location.href; | |
// Get all menu items | |
let menuItems = document.querySelectorAll('#mainNavigation ul li a'); | |
// Loop through each menu item to find the active page | |
for (var i = 0; i < menuItems.length; i++) { | |
if (menuItems[i].href === currentPageURL) { | |
menuItems[i].classList.add('active'); | |
} | |
} |
OlderNewer