Window screen.availWidth
Example
Get the available width of your screen:
let width = screen.availWidth;
Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The availWidth
property returns the width of the user's screen.
The availWidth
property returns the width in pixels.
The availWidth
property returns the width minus interface features like the Windows Taskbar.
The availWidth
property is read-only.
Note
To get the height of the screen, use the availHeight property.
Syntax
screen.availWidth
Return Value
Type | Description |
A number | The width of the user's screen in pixels. |
More Examples
All screen properties:
let text = "Total width/height: " + screen.width + "*" + screen.height + "<br>" +
"Available width/height: " + screen.availWidth + "*" + screen.availHeight + "<br>" +
"Color depth: " + screen.colorDepth + "<br>" +
"Color resolution: " + screen.pixelDepth;
Try it Yourself »
Browser Support
screen.availWith
is supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |