Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Hiya <strong>demo</strong> <a href="http://jsfiddle.net/keXRf/3/" rel="nofollow noreferrer">http://jsfiddle.net/keXRf/3/</a> (using <code>attr</code>) <strong>or</strong> you can always set the css like here and use <code>.css</code> <a href="http://jsfiddle.net/LAp2c/" rel="nofollow noreferrer">http://jsfiddle.net/LAp2c/</a></p> <p>link: <a href="http://api.jquery.com/height/" rel="nofollow noreferrer">http://api.jquery.com/height/</a> :)</p> <p>Note: since attributes <code>height=</code> is used in your case; you can use <code>attr</code> and that will give you desired output, but the link should help you to understand better.</p> <pre><code>$('#object1').attr("height") </code></pre> <p><strong>also</strong> extra info: you can assign <code>.css("height", 205)</code> for consistancy across bwoser, there is a good discussion in the link I shared above.</p> <p>further: The difference between <code>.css('height')</code> and <code>.height()</code> is that the latter returns a unit-less pixel value (for example, <code>400</code>) while the former returns a value with units intact (for example, <code>400px</code>). The <code>.height()</code> method is recommended when an element's height needs to be used in a mathematical calculation.</p> <p>screenshot 1: in osx safari</p> <p><img src="https://i.stack.imgur.com/DQKK5.png" alt="enter image description here"></p> <p>screenshot 2:</p> <p><img src="https://i.stack.imgur.com/V7dcS.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload