Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <button onclick="myFunction()">show the window size</button>
- <p id="demo"></p>
- <script>
- function myFunction() {
- var w = window.innerWidth;
- var h = window.innerHeight;
- document.getElementById("demo").innerHTML = "Width: " + w + "<br>Height: " + h;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement