Screen availHeight Property - Javascript Browser Object Model

Javascript examples for Browser Object Model:Screen

Description

The availHeight property returns the height of the user's screen, in pixels, minus interface features like the Windows Taskbar.

Return Value

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

The following code shows how to get the available 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   w  ww. j  a  va 2s. c  o m*/
    var x = "Available Height: " + screen.availHeight + "px";
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials