jQuery innerHeight Method
jQuery innerHeight Method : is used to get the height of selected element including the padding. It does not includes the border width it return height + padding as innerHeight.
Note : It will not add border width while returning the innerWidth.
We are going to explain this method with syntax, example and demo.
jQuery innerHeight Method Syntax
Here is syntax for innerHeight of container –
$(selector).innerHeight();
jQuery innerHeight Method Example
Run below example and see the result –
<script type="text/javascript"> $(document).ready(function(){ $( "#heightExample" ).on( "click", function(event) { var x = $("#myDiv").innerHeight(); $("#myDiv > p").html("Inner Height = "+x+"px"); }); }); </script> |
The above example will generate following result –
Advertisements