jQuery outerHeight Method


jQuery outerHeight Method : is used to get the height of selected element including the padding and border. OuterHeight method returns total height of the container. Here is syntax and example with complete demo of
jQuery OuterHeight() method.


jQuery outerHeight Method Syntax

Here is syntax for outer Height-

$(selector).outerHeight();

jQuery outerHeight Method Example

Below is example which is showing outerHeight with Example and demo –

<script type="text/javascript">
         $(document).ready(function(){ 
              $( "#heightExample" ).on( "click", function(event) {             
                  var x = $("#myDiv").outerHeight();       
                          $("#myDiv > p").html("Outer Height = "+x+"px");     
              });               
          });
</script>

Try it »

The above example will produce the following result –

jQuery outerHeight Method


Advertisements

Add Comment

📖 Read More