Javascript screen availWidth property returns the available width of the display screen of the computer monitor based on resolution of the screen. availWidth property of screen object gives approximate value of width available to display the content in a browser along x-axis. Value returned by javascript screen object availWidth property does not match the actual available space inside the body section of web browsers due to number of toolbars and some other properties such as status bar and scrollbars. availWidth property returns the width in pixels without excluding the width of window’s taskbar coz in Windows operation system, according to default settings, position of taskbar is bottom of display screen.
Syntax for Javascript Screen availWidth property
screen.availWidth
or
window.screen.availWidth
You can use any of the above syntax to access the javascript screen availWidth property.
Examples of Javascript Screen availWidth property
<script type="text/javascript" language="javascript">
document.write(screen.availWidth);
document.write("<br />");
document.write(window.screen.availWidth);
</script>
Continue to next tutorial: Javascript screen availHeight property to learn how to get available screen height.