Window height and width

In this chapter you will learn:

  1. How to get window size, width, height in Javascript

Size of a window

window's outer width and height, inner height and width.

<!DOCTYPE HTML> <!--from j  a  v  a 2 s . c o  m-->
<html> 
    <body> 
        <script type="text/javascript"> 
            document.writeln(window.outerWidth); 
            document.writeln(window.outerHeight); 
            document.writeln(window.innerWidth); 
            document.writeln(window.innerHeight); 
            document.writeln(window.screen.width); 
            document.writeln(window.screen.height); 
        </script> 
    </body> 
</html>

Click to view the demo

Next chapter...

What you will learn in the next chapter:

  1. Change the URL location for a window
Home » Javascript Tutorial » Window
Window Object
alert()
close()
confirm()
find()
Window height and width
location
window.moveBy
window.moveTo
window.open()
window.print()
window.prompt()
resizeTo(x,y) and resizeBy(xDelta,yDelta)
window.scrollTo(x,y)
screenLeft, screenX, screenTop, screenY
setInterval()
setTimeout()