
JavaScript
0
Вклад в тег
.menu-item__link,
.active.menu-module__text {
color: #fff;
}
.active .item-link__text {color:#fff;} /* Нужен был пробел перед active. Поэтому он не окрасил div внутри </a>*/
const currentLocation = location.href;
const menuItem = document.querySelectorAll('.menu-item__link');
const menuLenght = menuItem.length
for (let i = 0; i<menuLenght; i++) {
if (menuItem[i].href === currentLocation) {
menuItem[i].className = "active menu-item__link";
}
}