Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Get Screen Resolution</title> </head> <body> <script> function getResolution() { alert("Your screen is: " + screen.width + "x" + screen.height); } </script> <button type="button" onclick="getResolution();">Get Resolution</button> </body> </html>