Window screen.availWidth Property

Definition and Usage

availWidth property returns the width of the user's screen.

availWidth property returns the width in pixels.

availWidth property returns the width minus the width of the Windows taskbar and other interface functions.

availWidth The property is read-only.

Tip:To get the height of the screen, use availHeight property.

Example

Example 1

Get the available width of the screen:

let width = screen.availWidth;

Try it Yourself

Example 2

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

Syntax

screen.availWidth

Return Value

Type Description
Number The width of the user's screen (in pixels).

Browser Support

All browsers support screen.availWith:

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support Support Support Support Support Support

Related Pages

HTML DOM Reference Manual:screen.availHeight property

HTML DOM Reference Manual:screen.availWidth property

HTML DOM Reference Manual:screen.height property

HTML DOM Reference Manual:screen.width Property