mirror of https://github.com/corca-ai/EVAL
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
320 B
JavaScript
12 lines
320 B
JavaScript
const highlightActiveNavItem = () => {
|
|
const navItems = document.querySelectorAll("#nav-sidebar > li > a");
|
|
const currentPath = window.location.pathname;
|
|
navItems.forEach((item) => {
|
|
if (item.getAttribute("href") === currentPath) {
|
|
item.classList.add("active");
|
|
}
|
|
});
|
|
};
|
|
|
|
highlightActiveNavItem();
|