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