Screen.availWidth

The Screen.availWidth property returns the amount of horizontal space (in pixels) available to the window.

Syntax

var width = window.screen.availWidth

Example

var screenAvailWidth = window.screen.availWidth;

console.log(screenAvailWidth);

Specifications

Specification Status Comment
CSS Object Model (CSSOM) View Module
The definition of 'Screen.availWidth' in that specification.
Working Draft Initial definition

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
availWidthChrome Full support YesEdge Full support 12
Notes
Full support 12
Notes
Notes Always reflects the main screen.
Firefox Full support YesIE ? Opera Full support YesSafari Full support 6WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support
Full support
Compatibility unknown
Compatibility unknown
See implementation notes.
See implementation notes.