title: How to get an HTML element's style values in JavaScript?
body: <p>I am looking for a way to retrieve the style from an element that has a style set upon it by the style tag.</p>
  
  <pre><code>&lt;style&gt; 
  #box {width: 100px;}
  &lt;/style&gt;
  </code></pre>
  
  <p>In the body  </p>
  
  <pre><code>&lt;div id="box"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I'm looking for straight javascript without the use of libraries.</p>
  
  <p>I tried the following, but keep receiving blanks:</p>
  
  <pre><code>alert (document.getElementById("box").style.width);  
  alert (document.getElementById("box").style.getPropertyValue("width"));
  </code></pre>
  
  <p>I noticed that I'm only able to use the above if I have set the style using javascript, but unable to with the style tags.</p>