100-project-100-days-website/100_projects/26-magic-navigation-menu-indicator/js/main.js
2023-03-19 17:23:21 +03:00
Ask

9 lines
249 B
JavaScript

{fac5530b7a00a250e44282fcf40ab6ca91695e45 true 249 main.js 0xc0030cc540}

const list = document.querySelectorAll('.list');
function activeClick(){
list.forEach((itme) =>
itme.classList.remove("active"));
this.classList.add("active");
}
list.forEach((item) =>
item.addEventListener('click', activeClick));