The Screen Object

The screen object is used as an indication of client capabilities.

The following table list all properties from screen object supported by all major browsers.

NameDescriptionReturns
availHeightThe pixel height of the screen minus system elements such as toolbar (read only)number
availWidthThe pixel width of the screen minus system elements such as toolbar(read only)number
colorDepthThe number of bits used to represent colors; for most systems, 32 (read only)number
heightReturns the pixel height of the screen.number
widthReturns the pixel width of the screen.number

To resize the browser to take up the available space in the screen:

 
<!DOCTYPE html>
<html>
<head>
    <title>Example</title>
    <script type="text/javascript">
        window.resizeTo(screen.availWidth, screen.availHeight); 

    </script>
</head>
<body>
</body>
</html>
  
Click to view the demo
Home 
  JavaScript Book 
    DOM