Find the viewport's height via window object - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window innerHeight

Description

Find the viewport's height via window object

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <style>

body { height: 3000px; }

      </style> 
      <script>
    onload = function() {//from w w  w  .j  ava  2  s.  c o m
        console.log(window.innerHeight)
    }

      </script> 
   </head> 
   <body>
       hi  
   </body>
</html>

Related Tutorials