How to get the If Else to work on click?
<pre><code>$(cell).click(function(){
  var cellColor = $(this).css("background-color");

  if(cellColor != "red"){
    $(this).css("background-color", "red");
  }else{    
    $(this).css("background-color", "blue");
  }
});
</code></pre>

<p>Hi,</p>

<p>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)?</p>

<p>Thanks</p>
