Home >>jQuery Tutorial >jQuery innerHeight() Method

jQuery innerHeight() Method

jQuery innerHeight() Method

jQuery innerHeight() method is used to returns the inner height of the FIRST matched element includes padding, but note margin and border.

Syntax:
$(selector).innerHeight()
Here is an Example of jQuery innerHeight() Method:

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".btn1").click(function(){
alert("Inner height of div: " + $(".innerheight1").innerHeight());
});
});
</script>
</head>
<body>
<div class="innerheight1" style="height:50px;width:150px;padding:15px;margin:5px;border:1px solid #000;background-color:#a4e838;"></div><br>
<button class="btn1">click me to Display the inner height of div</button>
</body>
</html>

Output: