Window outerHeight Property - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window outerWidth outerHeight

Description

The outerHeight property returns the outer height of a window, including all interface elements (toolbars/scrollbars).

The property is read-only.

Return Value

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

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials