/

HTML / CSS / JavaScript Tutorial

JavaScript Window property: outerHeight

[this page | pdf | back links]

The outerHeight property (of the JavaScript BOM window object) returns the height of the window including toolbars, scrollbars etc.

 

EXAMPLE:


HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head></head>
<body onresize="myOnresize()">
try resizing window
<br><br>
Window outer size: <b id="outersize"></b><br>
Window inner size: <b id="innersize"></b><br>

<script>
function myOnresize() {
  var x = window.outerWidth;
  var y = window.outerHeight;
  document.getElementById("outersize").innerHTML = 
    x + " x " + y;
  x = window.innerWidth;
  y = window.innerHeight;
  document.getElementById("innersize").innerHTML =
    x + " x " + y;
}
</script>

</body>
</html>


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile