I\'m trying to remove and set an active class for a list item every time it\'s clicked. It\'s currently removing the selected active class but isn\'t setting it. Any idea w
this will point to the selected by .nav-list. You can use delegation instead!
this
.nav-list
$('.nav-list').on('click', 'li', function() { $('.nav-list li.active').removeClass('active'); $(this).addClass('active'); });