Window innerWidth property
- Previous Page innerHeight
- Next Page length
- Go to the Previous Level Window Object
Definition and Usage
innerWidth
The property returns the width of the window content area.
innerWidth
The property is read-only.
See also:
Instance
Example 1
Get the window width:
let width = window.innerWidth;
let width = innerWidth;
Example 2
All height and width properties:
let text = "<p>innerWidth: " + window.innerWidth + "</p>" + "<p>innerHeight: " + window.innerHeight + "</p>" + "<p>outerWidth: " + window.outerWidth + "</p>" + "<p>outerHeight: " + window.outerHeight + "</p>";
Syntax
window.innerWidth
Or:
innerWidth
Return value
Type | Description |
---|---|
Number | The internal width of the browser window content area (in pixels). |
Browser Support
All Browsers Support window.innerWidth
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | 9-11 | Support | Support | Support | Support |
- Previous Page innerHeight
- Next Page length
- Go to the Previous Level Window Object