首页javascriptwidthjQuery Style - 如何得到外部宽度和外部高度

jQuery Style - 如何得到外部宽度和外部高度

我们想知道如何得到外部宽度和外部高度。

<html>
  <head>
    <script type='text/javascript' src='http://code.jquery.com/jquery-1.5.2.js'></script>
    <script type='text/javascript'>
$(document).ready(
  function() {
    console.log(
      'outerWidth: '  + $('div').outerWidth() + "\n" + 
      'outerHeight: ' + $('div').outerHeight()
    );
  }
);
    </script>
    <style type='text/css'>

div {
    width: 200px;
    height: 200px;
    padding: 10px;
    border: 1px solid rgb(200, 200, 200);
    background: lightblue;
}
    </style>
  </head>
  <body>
    <div></div>
  </body>
</html>