• Skip to main content
  • Skip to search
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web technology for developers
  2. Web APIs
  3. Screen
  4. Screen.availWidth
  • Change language

Table of contents

  • Syntax
  • Example
  • Specifications
  • Browser compatibility

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

BCD tables only load in the browser

Found a problem with this page?

  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Apr 4, 2021, by MDN contributors

Change your language

Related Topics

  1. Screen
  2. Properties
    1. availHeight
    2. This API has not been standardized. availLeft
    3. This API has not been standardized. availTop
    4. availWidth
    5. colorDepth
    6. height
    7. This API has not been standardized. left
    8. This API has not been standardized. This deprecated API should no longer be used, but will probably still work. mozBrightness
    9. This API has not been standardized. This deprecated API should no longer be used, but will probably still work. mozEnabled
    10. This deprecated API should no longer be used, but will probably still work. onorientationchange
    11. This is an experimental API that should not be used in production code. orientation
    12. pixelDepth
    13. This API has not been standardized. top
    14. width
  3. Methods
    1. This deprecated API should no longer be used, but will probably still work. lockOrientation()
    2. This deprecated API should no longer be used, but will probably still work. unlockOrientation()
  4. Inheritance:
    1. EventTarget
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

Mozilla

© 2005-2021 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies