I am kind of confused why my code doesn\'t work correctly, I hope You will tell me what I\'ve done wrong. I want to highlight navigation tab while clicked.
HTML:
var list = document.querySelector('ul'); list.addEventListener('click', function(ev) { if (ev.target.tagName === 'LI') { ev.target.classList.toggle('checked'); } }, false);