Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h2>Get the size of the current screen/window</h2> <p>The example displays the browser window's height and width: (NOT including toolbars/scrollbars) <p id="demo"></p> <script> var w = window.innerWidth; var h = window.innerHeight; var x = document.getElementById("demo"); x.innerHTML = "Browser width: " + w + ", height: " + h + "."; </script> </body> </html>