jQuery - Change color on click
Create a CSS class:
.clicked {
background-color: yellow;
}
and then simply toggle that class it via jQuery:
$('.star').click(function(){
$(this).toggleClass('clicked');
});
You could set a flag in your click function, Then add an if statement
if hasBeenClicked = true;
//...background color remove
else
//....background color changed to yellow
hasBeenClicked = true;