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