width property (screen)
Returns the horizontal resolution of the display screen, in pixels.
- Use the height property to get the height and the top and left properties to retrieve the top-left corner of the screen.
- If you need the dimensions of the area on the screen that is available for application windows, use the availWidth, availHeight, and the availLeft, availTop properties of the screen object.
- To get the size and the top-left corner of the browser window, use the outerWidth, outerHeight and the screenX, screenY properties.
You can find the related objects in the Supported by objects section below.
This property is read-only.
Integer that sets or retrieves the resolution, in pixels.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the width property:
Did you find this example helpful?
User Contributed Comments