How to get browser inner window width and height in JavaScript

1 Answer

0 votes
var width = window.innerWidth
            || document.documentElement.clientWidth
            || document.body.clientWidth;

var height = window.innerHeight
            || document.documentElement.clientHeight
            || document.body.clientHeight;


document.write("Browser inner window width: " + width + ", height: " + height)            
            
/*
run:
  
Browser inner window width: 873, height: 792 
  
*/

 



answered Jul 13, 2015 by avibootz
...