Javascript examples for jQuery Method and Property:innerHeight
The innerHeight() method returns the inner height including padding but not border and margin of the FIRST matched element.
The following code shows how to Return the inner height of a <div> element:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ console.log("Inner height of div: " + $("div").innerHeight()); });//from w w w. j a v a2s . c o m }); </script> </head> <body> <div style="height:100px;width:300px;padding:10px;margin:3px;border:1px solid blue;background-color:red;"></div><br> <button>Display the inner height of div</button> </body> </html>