Javascript examples for Browser Object Model:Screen
The pixelDepth property returns the color resolution of the visitor's screen.
A Number, representing the color resolution, in bits per pixel.
Possible values:
The following code shows how to get the color resolution of your screen:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww . j a v a 2 s . com*/ var x = "Color resolution: " + screen.pixelDepth + " bits per pixel"; document.getElementById("demo").innerHTML = x; } </script> </body> </html>