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
Try this,
$('.nav-list li').click(function() { $('.nav-list li.active').removeClass('active'); $(this).addClass('active'); });
In your context $(this) will points to the UL element not the Li. Hence you are not getting the expected results.
$(this)
UL
Li