I want to have 5 lists such than when any of them is clicked, it turns to green and turn the other lists to black if any of them is green.
Here\'s m
One solution is this:
$("ul > li").on("click", function(){ $("ul li").css("color", "black"); $(this).css("color", "green"); });
li{ list-style:none; cursor:pointer; }
one two three four five