Screen height Property - Javascript Browser Object Model

Javascript examples for Browser Object Model:Screen

Description

The height property returns the total height of the user's screen, in pixels.

Return Value

A Number, representing the total height of the user's screen, in pixels

The following code shows how to get the total height of your screen:

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   ww  w.  jav a2 s  .  c om*/
    var x = "Total Height: " + screen.height + "px";
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials