Javascript examples for CSS Style Property:lineHeight
Get the line height of a <div> element:
<!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>/*w w w . j ava2 s. com*/ <button type="button" onclick="myFunction()">Get line height</button> <script> function myFunction() { console.log(document.getElementById("myDiv").style.lineHeight); } </script> </body> </html>