window.innerHeight; // returns browser view port height in pixels window.innerWidth; // returns browser view port width in pixels
The window object provides the
innerWidth of the browser window. These values represent the actual pixels in the browser window that the web page will be displayed within. This is a critical piece of information if you need to adjust the size and location of elements on the web page based on the actual area that is being displayed.