Javascript screen height property returns the height of display screen. height property of javascript screen object actually returns the number of pixels in vertical direction i.e. vertical value for screen resolution along y-axis. Javascript screen object height property depends upon the screen resolution of client system. For example if screen resolutions of client’s PC is 800 X 600 then it represents the height as 600 pixels in a single vertical column along y-axis and height property of javascript screen object returns the value equal to 600. You can see the screen resolution property in the display properties of the computer system that can be accessed by right clicking on desktop and selecting the properties from the menu or by selecting Display icon in the control panel. Display properties dialog box shows the tabs for different types of display settings such as wallpaper, screensaver, themes, appearance and settings. In the settings tab you can see the current value of screen resolutions.
Syntax for Javascript screen height property
screen.height
or
window.screen.height
You can use any of the above syntax to access the javascript screen height property.
Examples of Javascript screen width property
<script type="text/javascript" language="javascript">
document.write(screen.height);
document.write("<br />");
document.write(window.screen.height);
</script>
Continue to next tutorial: Javascript screen width property to learn how to get the display width as number of pixels along x-axis of screen.