$(cell).click(function(){
var cellColor = $(this).css("background-color");
if(cellColor != "red"){
$(this).css("background-color", "red");
}else{
$(this).css("background-color", "blue");
}
});
Hi,
Why isn’t the else statement working here please when clicking on the same cell again (i.e. the background of the cell has turned into red on first click as intended)?
Thanks
jQuery returns color codes not by names, but RGB – http://jsfiddle.net/cHWxv/