Window screen.availHeight Property

Definition and usage

availHeight The property returns the height of the user's screen.

availHeight The property returns the height in pixels.

availHeight The property returns the height minus the height of interface functions such as the Windows taskbar.

Tip:To get the screen width, use availWidth attribute.

Example

Example 1

Get the available height of the screen:

let height = screen.availHeight;

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.availHeight

Return value

Type Description
Number The height of the user's screen, in pixels.

Browser support

All browsers support screen.availHeight:

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 attribute

HTML DOM Reference Manual:screen.availWidth attribute

HTML DOM Reference Manual:screen.height attribute

HTML DOM Reference Manual:screen.width Property