Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What is Jquery innerHeight method ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 241
    Comment on it

    Hello Readers,

    innerHeight() is the jquery method which is used get or computed the innerHeight of the jquery matched element, this method including padding while computing innerHeight of the element but not consider the border and margin of the element.

    Syntax :

    $(selector).innerHeight()
    

    In the above syntax there is no parameter inside innerHeight() method

    Code Example :

    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
        $("button").click(function(){
            alert("Inner height of div: " + $("div").innerHeight());
        });
    });
    </script>
    </head>
    <body>
    
    <div style="height:100px;width:300px;padding:10px;margin:3px;border:1px solid blue;background-color:lightblue;"></div><br>
    
    <button>Display the inner height of div</button>
    <p>innerHeight() - returns the inner height of an element (includes padding).</p>
    
    </body>
    </html>
    

    In the above code when we click on button it get the inner height of the div section of an element including padding but not border and margin of the div in jquery.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: