Code to determine the size of the browser window using javascript

Prabhukiran345
Posted by Prabhukiran345 under JavaScript category on | Points: 40 | Views : 450
<script>
var w=window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;

var h=window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;

x=document.getElementById("demo");
x.innerHTML="Browser inner window width: " + w + ", height: " + h + "."
</script>


My Output:
Browser inner window width: 614, height: 492.

Comments or Responses

Login to post response