I want to attach a function on every link on the site to change a parameter.
How can I do this without jQuery?
How do I traverse every link (it might be a DO
better way:
const item = document.querySelectorAll(".nav__item"); item.forEach(link => { link.addEventListener("click", function () { link.classList.add("nav__item--active"); }); });