For the first two .nav-item
I see they are referring to different files. So in their curresponding files, you can mark them active
.
For rest of the three .nav-item
you can use (I am using JQuery since you mentioned it)
$('#nav-bar').on('click', '.nav-item', function(e) { $('.nav-item.active', e.currentTarget).removeClass('active'); $(this).addClass('active');}
make sure the css for the .active
is being applied correctly.