Get the color resolution of your screen:
var x = "Color Resolution: " + screen.pixelDepth;
Click the button to display the color resolution of your screen.
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*ww w .j a v a 2 s. c o m*/ var x = "Color resolution: " + screen.pixelDepth + " bits per pixel"; document.getElementById("demo").innerHTML = x; } </script> </body> </html>
The pixelDepth property returns the color resolution in bits per pixel of the visitor's screen.
Possible values: