Screen widthProperty
Screen Object
Definition and Usage
The width property declares the width of the screen that displays the browser, in pixels.
Syntax
screen.width
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the width property.
Example
Example
Return the total width of your screen:
<script>
document.write("Total width: " + screen.width);
</script>
document.write("Total width: " + screen.width);
</script>
The output of the above example is:
Try it Yourself »
More Examples
This example includes all screen properties.
Screen Object Other Extensions