I have a list of 6 items that are in a global div (navigationagence) Right now I am able to add a class on click but right now they adds up which means that once my six item
Alternatively you can use:
$("#navigationagence ul li").click(function() {
$(".currentagence").removeClass("currentagence");
$(this).addClass("currentagence");
});
You can use the siblings() method to get the other list items and remove the class from them:
$("#navigationagence ul li").click(function() {
$(this).addClass("currentagence").siblings().removeClass("currentagence");
});