Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Get Available Width and Height of the Screen</title> </head> <body> <script> function getAvailSize() { alert("Available Screen Width: " + screen.availWidth + ", Height: " + screen.availHeight); } </script> <button type="button" onclick="getAvailSize();">Get Available Size</button> </body> </html>