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. <head>
  3. <style>
  4. p {
  5. border: 2px solid blue;
  6. padding: 10px;
  7. }
  8. </style>
  9. <script src="http://code.jquery.com/jquery-latest.js"></script>
  10. </head>
  11. <body>
  12. <p>My Name is Mahak</p>
  13. <p></p>
  14. <script>
  15. var x = $("p:first");
  16. $("p:last").text("innerHeight of the previous Paragraph:" + x.innerHeight());
  17. </script>
  18. </body>
  19. </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