Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Get Color Depth of the Screen</title> </head> <body> <script> function getColorDepth() { alert("Your screen color depth is: " + screen.colorDepth); } </script> <button type="button" onclick="getColorDepth();">Get Color Depth</button> </body> </html>