Javascript examples for Browser Object Model:Window innerHeight
The innerHeight property returns the inner height of a window's content area.
The property is read-only.
A Number, representing the inner height of the browser window's content area, in pixels
The following code shows how to get the window's height and width:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from www. j av a 2s.co m var w = window.innerWidth; var h = window.innerHeight; document.getElementById("demo").innerHTML = "Width: " + w + "<br>Height: " + h; } </script> </body> </html> </html>