title: Why does element.style.display is blank if display declared on CSS
body: <p>Why does this JS return blank if the style is declared in CSS, and works good when declared inline?</p>
  
  <pre><code>//html
  &lt;img id="myImg" src="http://jsfiddle.net/favicon.png" /&gt;
  &lt;img id="myImg2" src="http://jsfiddle.net/favicon.png" style="display:none;" /&gt;
  
  /css
  #myImg {
      display:none;
  }
  
  //vanilla JS
  var el = document.getElementById('myImg');
  var el2 = document.getElementById('myImg2');
  console.log(el.style.display); // blank
  console.log(el2.style.display); // 'none' - as expected
  </code></pre>
  
  <p><strong><a href="http://jsfiddle.net/3eyAF/" rel="noreferrer">Fiddle here</a></strong></p>