Return the line height of a <div> element:
alert(document.getElementById("myDiv").style.lineHeight);
<!DOCTYPE html> <html> <body> <div id="myDiv" style="line-height:450%;"> This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. </div>//from w ww . ja v a 2 s . c o m <button type="button" onclick="myFunction()">Get line height</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.lineHeight; } </script> </body> </html>