var mySpan=document.getElementById("mySpan"); alert(mySpan.height);
<span id="mySpan" style="line-height:200px;">hello world</span>
However, the result I receive is undefined
. This is because Javascript can only retrieve the height of block or inline-block elements.