Bootstrap menu change li active class on click
UPDATED
Your css selectors seems to be wrong. Please try as given below,
<script>
$(".nav li").on("click", function() {
$(".nav li").removeClass("active");
$(this).addClass("active");
});
</script>
I have created a plunkr for this here
Try this:
$("ul li").on("click", function() {
$("li").removeClass("active");
$(this).addClass("active");
});
You will have to play around with it with your given tags. What helped me was declaring this to become active, then removing the active class.