Javatpoint Logo

91-9990449935

 0120-4256464

JavaScript Screen Object

The JavaScript screen object holds information of browser screen. It can be used to display screen width, height, colorDepth, pixelDepth etc.

The navigator object is the window property, so it can be accessed by:

Or,


Property of JavaScript screen object

There are many properties of screen object that returns information of the browser.

No.PropertyDescription
1widthreturns the width of the screen
2heightreturns the height of the screen
3availWidthreturns the available width
4availHeightreturns the available height
5colorDepthreturns the color depth
6pixelDepthreturns the pixel depth.

Example of screen object

Let’s see the different usage of screen object.

Test it Now
screen.width: 1366 
screen.height: 768 
screen.availWidth: 1366 
screen.availHeight: 728 
screen.colorDepth: 24 
screen.pixelDepth: 24