Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript : How to get the window width and height?

I want to get the window height and width including Address bar , status bar,etc...

How can I get the window full height and width as shown in the picture below ?

enter image description here

Note : I know about the window.innerHeight and window.innerWidth . It does not suits for this scenario. window.innerHeight is used to get the DOM height only.outerWidth also does not gives what I have want.

Hope our stack users will give a good solution with cross browser compatibility.

like image 942
Human Being Avatar asked Mar 19 '23 23:03

Human Being


1 Answers

use this if you want without scrollbars etc.. :

window.innerHeight; // for height

window.innerWidth; // for width

else in your case, if you want it full, use the below.

window.outerHeight; // for height

window.outerWidth; // for width
like image 69
Amit Joki Avatar answered Apr 02 '23 11:04

Amit Joki