Window outerWidthandouterHeightProperty
Window Object
Definition and Usage
The outerHeight property sets or returns the outer height of a window, including all interface elements (such as toolbars/scrollbars).
The outerWidth property sets or returns the outer width of a window, including all interface elements (such as toolbars/scrollbars).
outerWidth and outerHeight are read-only properties.
Note:UseinnerWidth and innerHeightproperties to get the window height and width excluding toolbars and scrollbars.
Syntax
Get the width and height of the window:
window.outerWidth window.outerHeight
Set the width and height of the window:
window.outerWidth=pixels window.outerHeight=pixels
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| outerWidth | 1.0 | 9.0 | 1.0 | 3.0 | 9.0 |
| outerHeight | 1.0 | 9.0 | 1.0 | 3.0 | 9.0 |
Example
Example
Get the height and width of the window (including toolbars/scrollbars):
Try it Yourself »
The following demonstrates the use of innerWidth, innerHeight, outerWidth and outerHeight:
Example
Try it Yourself »
Window Object Other Extensions