Jump to Categories

Vanilla JS

Add event listener to class items


const navdemos = Array.from(document.querySelectorAll('nav.demos > .demo'));

navdemos.forEach(link => link.addEventListener('click', (ev) => {
	ev.preventDefault();
	navigate(ev.target);
}));