title: attempting to change background color based on current background: background color has no value
body: <p>So this is a very simple application.  Essentially, I have my initial background set by CSS.  I want to be able to read the current background color in javascript and update it.  Currently, my alert in the updateBackground function shows no text at all, despite the fact that my CSS is definitely loaded and there is no race problem due to waiting on deviceReady.  I could easily hack around this by setting the backgroundColor in javascript, but I'd like to understand this behavior.</p>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>body{
  background-color: green;
  }
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>    var updateBackground = function() {
          alert(document.body.style.backgroundColor);
          document.body.style.backgroundColor=document.body.style.backgroundColor == '#E4E4E4' ? 'green' :  '#E4E4E4';
      };
  class App{
     constructor() {
         this.bindEvents();
     }
     bindEvents() {
         document.addEventListener('deviceready', this.onDeviceReady, false);
     }
     onDeviceReady(){
         document.addEventListener('touchstart', function() {
             updateBackground();
         }, false);
     }
  }
  var app = new App();
  </code></pre>