Javascript examples for Browser Object Model:Window outerWidth outerHeight
The outerWidth property returns the outer width of a window, including all interface elements (toolbars/scrollbars).
The property is read-only.
A Number, representing the outer width 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() {/* w w w .ja v a 2 s. com*/ var w = window.outerWidth; var h = window.outerHeight; document.getElementById("demo").innerHTML = "Width: " + w + "<br>Height: " + h; } </script> </body> </html>