screen.pixelDepth

JavaScript 1.2+ Nav4+ Syntax

screen.pixelDepth

Description

The pixelDepth property of the screen object accesses the number of bits per pixel of the user's screen.

Example

Listing 7.461 displays the pixel depth of the user's screen to the page.

Listing 7.461 Accessing the pixelDepth Property of the screen Object
<script language="JavaScript1.2">
<!-- Hide

document.write("The pixel depth of this user's screen is <b>");
document.write(screen.pixelDepth + '</b> bit');

// End hide --->
</script>
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.