Reputation: 23054
Within a particular div/span that I might dynamically insert into the DOM, I need to find the 1em
computed height(height after rendering) within that DOM element.
Just wanted to know if anyone already knows of a good way to do this before I start out.
Upvotes: 1
Views: 246
Reputation: 303224
In jQuery you want the .css()
method. For example, here on Stack Overflow:
$(document.body).css('line-height'); //-> "12px"
In 'vanilla' JavaScript you want getComputedStyle
[specs] for modern browsers, or currentStyle
for older IE versions.
Upvotes: 1