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
you can use siblings and removeClass method
$('.nav-link li').click(function() { $(this).addClass('active').siblings().removeClass('active'); });