$(function() {
$("li").click(function() {
// remove classes from all
$("li").removeClass("active");
// add class to the one we clicked
$(this).addClass("active");
});
});
It would be wise to give meaningful classes to the 's so you can properly select just those, but you get the idea.