Javascript examples for jQuery:Width Height
Get the height of <div>, including padding, border and margin.
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ console.log($("div").outerHeight(true)); });/*from w w w. jav a 2 s.c om*/ </script> <style> div { height: 100px; width: 300px; padding: 10px; margin: 3px; border: 1px solid blue; background-color: lightblue; } </style> </head> <body> <div>I am a div.</div> </body> </html>