Returns the amount of horizontal space in pixels available to the window.

Syntax

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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support Yes
Notes
Full support Yes
Notes
Notes Always reflects the main screen.
Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

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

Document Tags and Contributors

Contributors to this page: fscholz, Sebastianz, teoli, paulmand3l, namolmes, Sheppy, ethertank, Mgjbot, Gor1
Last updated by: fscholz,