title: Why is this jQuery code not working to alter background-color in Firefox?
body: <p>I'm trying to get the hang of jQuery and I had this simple bit of code that refuses to work. Anyone got an idea of why this might not be working?</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
  
    &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
        $("div").live("click", divclicked);
      });
  
      function divclicked()
      {
        if($(this).css("background-color") == "lightblue")
          $(this).css("background-color", "red");
      }
    &lt;/script&gt;
  
    &lt;style type="text/css"&gt;
  
        div
        {
           background-color: lightblue;
        }
  
    &lt;/style&gt;
  
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="testdiv"&gt;
        this is a test
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks in advance for any inputs.</p>
  
  <p>Update:
      The solution below to use "backgroundColor" instead of "background-color" works when the style is inline, not if you use a stylesheet.</p>
  
  <pre><code>I have updated the example to use a stylesheet.
  </code></pre>