JavaScript BOM width and height methods

 <DOCTYPE html>

<html>

 <head>

  <title> Window object methods</title>

 </head>

 <body onresize="resize()">

  <script>

   function resize()

   {

    console.clear();

    var iheight = window.innerHeight;

    console.log("Inner Height : "+iheight);

  

    var oheight = window.outerHeight;

    console.log("Outer Height : "+oheight);

    

    var iwidth = window.innerWidth;

    console.log("Inner Width: "+iwidth);    


    var owidth = window.outerWidth;

    console.log("Outer Width : "+owidth);

   }

  </script> 

 </body>

</html>


OUTPUT




Comments