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
You can just do
$('li').click(function(){ $('li').css('color','black'); $(this).css('color', 'green'); });
DEMO The above is simple, but you can create classes and add/remove it using addClass/removeClass.