I’ve been trying to use $(“.someid”).height() to determine the height of a paragraph using jQuery, but the result always returns 0. What gives?
<p class="someid">Blah this is a test, I am trying to see when this wraps around what height it might have. I want to know how tall this paragraph element i because it can change from element to element.</p>.
I’ve tried using display:block in the css, or even height:auto to see if I can force CSS to consider it to be a block of text, but no results there either.
Thanks!
You are probably doing the declaration on $(document).ready(), at which time the element is not rendered on the page, so there is no height. You’ll have to do it on $(window).load() at which time the paragraph element will be rendered and will have a height.