Home
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <style> .test { padding: 10px; background-color: coral; } </style> <script> $(document).ready(function () { $("button").click(function () { // set inner height $('#mydiv').innerHeight(200); // get inner height var ht = $('span.test').innerHeight(); alert("the height of span tag is " + ht); }); }); </script> </head> <body> <h1>jQuery Manipulation Methods: innerHeight()</h1> <span class="test">This is a span tag</span> <div id="mydiv" style="background-color: aquamarine;"> <p>This is a paragraph</p> <p>This is a paragraph</p> </div> <button>Click Here to Test .innerHeight()</button> </body> </html>
Result: