- JavaScript Basics
- JavaScript Home
- JavaScript Syntax
- JavaScript Placements
- JavaScript Output
- JavaScript Statements
- JavaScript Keywords
- JavaScript Comments
- JavaScript Variables
- JavaScript var
- JavaScript let
- JavaScript const
- JavaScript var Vs let Vs const
- JavaScript Operators
- JavaScript Comparison/Logical
- JavaScript Data Types
- JS Conditional Statements
- JavaScript Conditional Statement
- JavaScript if Statement
- JavaScript if-else Statement
- JavaScript switch Statement
- JavaScript Loops
- JavaScript for Loop
- JavaScript while Loop
- JavaScript do-while Loop
- JavaScript Break Continue
- JavaScript Popup Boxes
- JavaScript Dialog Box
- JavaScript alert Box
- JavaScript confirm Box
- JavaScript prompt Box
- JavaScript Functions
- JavaScript Functions
- JS Function with Parameter
- JavaScript Return Statement
- JavaScript Variable Scope
- JavaScript setTimeout() Method
- JavaScript setInterval() Method
- JavaScript Events
- JavaScript Events
- JavaScript onclick Event
- JavaScript onload Event
- JavaScript Mouse Events
- JavaScript onreset Event
- JavaScript onsubmit Event
- JavaScript Objects
- JavaScript Objects
- JavaScript Number Object
- JavaScript Array Object
- JavaScript String Object
- JavaScript Boolean Object
- JavaScript Math Object
- JavaScript RegExp Object
- JavaScript Date Object
- JavaScript Browser Objects
- JavaScript Browser Objects
- JavaScript Window Object
- JavaScript Navigator Object
- JavaScript History Object
- JavaScript Screen Object
- JavaScript Location Object
- JavaScript Document Object
- JS Document Object Collection
- JS Document Object Properties
- JS Document Object Methods
- JS Document Object with Forms
- JavaScript DOM
- JavaScript DOM
- JavaScript DOM Nodes
- JavaScript DOM Levels
- JavaScript DOM Interfaces
- JavaScript Cookies
- JavaScript Cookies
- JavaScript Create/Delete Cookies
- JavaScript Advance
- JavaScript Regular Expression
- JavaScript Page Redirection
- JavaScript Form Validation
- JavaScript Validations
- JavaScript Error Handling
- JavaScript Exception Handling
- JavaScript try-catch throw finally
- JavaScript onerror Event
- JavaScript Multimedia
- JavaScript Animation
- JavaScript Image Map
- JavaScript Debugging
- JavaScript Browser Detection
- JavaScript Security
- JavaScript Misc
- JavaScript innerHTML
- JavaScript getElementById()
- JS getElementsByClassName()
- JS getElementsByName()
- JS getElementsByTagName()
- JavaScript querySelector()
- JavaScript querySelectorAll()
- JavaScript document.write()
- JavaScript console.log()
- JavaScript Programs
- JavaScript Programs
- JavaScript Test
- JavaScript Online Test
- Give Online Test
- All Test List
JavaScript Screen Object
The screen object in JavaScript represents the current display screen in your browser. Here is the general form to access the screen object property:
screen.propertyname
JavaScript Screen Object Properties
The following table describes the properties of the Screen object in JavaScript.
Property | Description |
---|---|
availHeight | specifies the height of the screen, excluding the Windows Taskbar |
availWidth | specifies the width of the screen, excluding the Windows Taskbar |
colorDepth | specifies the depth of the color palette, in bits, to display images |
height | specifies the total height of the screen |
pixelDepth | specifies the color resolution, in bits per pixel, of the screen |
width | specifies the total width of the screen |
JavaScript Screen Object Example
Here is an example illustrates screen object in JavaScript:
<!DOCTYPE HTML> <html> <head> <title>JavaScript Screen Object</title> </head> <body> <h3>JavaScript Screen Object Example</h3> <script type="text/javascript"> document.writeln("<b>Total Height = </b>" + screen.height + "<br/>"); document.writeln("<b>Total Weight = </b>" + screen.width + "<br/>"); document.writeln("<b>Available Width = </b>" + screen.availWidth + "<br/>"); document.writeln("<b>Available Height = </b>" + screen.availHeight + "<br/>"); document.writeln("<b>Screen Color Depth = </b>" + screen.colorDepth + "<br/>"); document.writeln("<b>Screen Pixel Depth = </b>" + screen.pixelDepth + "<br/>"); </script> </body> </html>
Here is the sample output produced by the above screen object in JavaScript example:

« Previous Tutorial Next Tutorial »