Javascript examples for Browser Object Model:Window outerWidth outerHeight
The outerHeight property returns the outer height of a window, including all interface elements (toolbars/scrollbars).
The property is read-only.
A Number, representing the outer height of the browser's window, including all interface elements, in pixels
The following code shows how to get the window's height and width
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w ww . ja v a 2 s . c o m var w = window.outerWidth; var h = window.outerHeight; document.getElementById("demo").innerHTML = "Width: " + w + "<br>Height: " + h; } </script> </body> </html>