title: Grabbing style.display property via JS only works when set inline?
body: <p>I'm trying to grab the DISPLAY property of a div on a page. I can only seem to grab it if it was set via an inline style attribute.</p>
  
  <p>If my JS is this:</p>
  
  <pre><code>alert(document.getElementById('myDiv').style.display);
  </code></pre>
  
  <p>It will alert 'block' with this HTML:</p>
  
  <pre><code>&lt;div id="myDiv" style="display: block;"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>However, if I set it via an external style sheet:</p>
  
  <pre><code>#myID {display: block}
  </code></pre>
  
  <p>and my HTML:</p>
  
  <pre><code>&lt;div id="myDiv"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>then my alert is an empty string.</p>
  
  <p>Why is this? </p>