This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.



Height (in pixels) of the browser window viewport including, if rendered, the horizontal scrollbar.

Property of dom/Windowdom/Window


Note: This property is read-only.

var height = window.innerHeight;

Return Value

Returns an object of type NumberNumber

Viewport height in CSS pixels


Assumes a frameset

var intFrameHeight = window.innerHeight; // or
var intFrameHeight = self.innerHeight; /* will return the height of the
frame viewport within the frameset */
var intFramesetHeight = parent.innerHeight; /* will return the height of
the viewport of the closest frameset */
var intOuterFramesetHeight = top.innerHeight; /* will return the height
of the viewport of the outermost frameset */


Graphical example The following figure shows the difference between outerHeight and innerHeight.

screenshot showing difference between innerHeight and outerHeight

See also

Related articles