title: How do I get a computed style?
body: <p>Can anybody please help me with a script.. or a way to get the value of</p>
  
  <pre><code>height : 1196px;
  width: 284px;
  </code></pre>
  
  <p>from the computed style sheet (webkit).  I know IE is different- as usual.  I cannot access the iframe (cross domain)—I just need the height/width.</p>
  
  <p>Screenshot of what I need (circled in red).  How do I access those properties?</p>
  
  <p><img src="https://i.stack.imgur.com/JoJz7.jpg" alt="enter image description here"></p>
  
  <p>Source</p>
  
  <pre><code>&lt;iframe id="frameId" src="anotherdomain\brsstart.htm"&gt;
   &lt;html id="brshtml" xmlns="http://www.w3.org/1999/xhtml"&gt;   
      \--I WANT THIS ELEMENTS COMPUTED BROWSER CSS HEIGHT/WIDTH
  
  &lt;head&gt;
  &lt;title&gt;Untitled Page&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
   BLA BLA BLA STUFF
  
  &lt;/body&gt;
  
  &lt;/html&gt;
     \--- $('#frameId').context.lastChild.currentStyle 
          *This gets the actual original style set on the other domain which is "auto"
          *Now how to getComputed Style?
  
  
  &lt;/iframe&gt;
  </code></pre>
  
  <p>The closest I got is this</p>
  
  <pre><code>$('#frameId').context.lastChild.currentStyle
  </code></pre>
  
  <p>That gives me the actual style on the HTML element which is "auto" and that is true as thats what's its set on the iframed document.</p>
  
  <p>How do I get the computed style that all the browsers use to calculate the scroll bars, and inspect elements values?</p>
  
  <p>Using Tomalaks answer I conjured up this lovely piece of script for webkit </p>
  
  <pre><code>window.getComputedStyle(document.getElementById("frameId"), null).getPropertyValue("height")
  </code></pre>
  
  <p>or</p>
  
  <pre><code>window.getComputedStyle(document.getElementById("frameId"), null).getPropertyCSSValue("height").cssText
  </code></pre>
  
  <p>Result      150px</p>
  
  <p>Identical to </p>
  
  <pre><code>$('#frameId').height();
  </code></pre>
  
  <p>So I got them to add a id of 'brshtml' to the head- maybe it will help me select the element easier. Webkit inspection shows me now html#brshtml but I cant select it using <code>getelementbyid</code></p>