X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Screen availWidth Property

Screen Object Reference Screen Object

Example

Get the available width of your screen:

var x = "Available Width: " + screen.availWidth;

The result of x will be:


Try it yourself »

More "Try it Yourself" examples below.


Definition and Usage

The availWidth property returns the width of the user's screen, in pixels, minus interface features like the Windows Taskbar.

Tip: To get the height of the screen (excluding the Windows Taskbar), use the availHeight property.


Browser Support

Property
availWidth Yes Yes Yes Yes Yes


Syntax

screen.availWidth

Technical Details

Return Value: A Number, representing the width of the user's screen, in pixels


Examples

More Examples

Example

All screen properties in one example:

var txt = "";
txt += "<p>Total width/height: " + screen.width + "*" + screen.height + "</p>";
txt += "<p>Available width/height: " + screen.availWidth + "*" + screen.availHeight + "</p>";
txt += "<p>Color depth: " + screen.colorDepth + "</p>";
txt += "<p>Color resolution: " + screen.pixelDepth + "</p>";

Try it yourself »


Screen Object Reference Screen Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook