innerHeight method in jquery

innerHeight method in jquery

 
This method is used to return the inner height of the Element. It also includes the padding of the element.
  1. <html>  
  2.   
  3.    <head>  
  4.       <style>  
  5.       p {  
  6.          border: 2px solid blue;  
  7.          padding: 10px;  
  8.       }  
  9.       </style>  
  10.       <script src="http://code.jquery.com/jquery-latest.js"></script>  
  11.    </head>  
  12.   
  13.    <body>  
  14.       <p>My Name is Mahak</p>  
  15.       <p></p>  
  16.       <script>  
  17.       var x = $("p:first");  
  18.       $("p:last").text("innerHeight of the previous Paragraph:" + x.innerHeight());  
  19.       </script>  
  20.    </body>  
  21.   
  22. </html> 
In this example, we take two Paragraphs. The second Paragraph will show the inner height of the first Paragraph.
  1. $("p:last").text( "innerHeight of the previous Paragraph:" + x.innerHeight() );  
Output:
 
1.png