JS screen & browser dimensions


/ Published in: JavaScript
Save to your folder(s)

pretty basic; dimensions of screen and browser display window


Copy this code and paste it in your HTML
  1. <script type="text/javascript" language="JavaScript">
  2. document.write("screen width = " + screen.width + "px.<br>");
  3. document.write("screen height = " + screen.height + "px.<br>");
  4. document.write("browser width = " + document.documentElement.clientWidth + "px.<br>");
  5. //document.write("browser width is " + document.body.clientWidth + "px.<br>");
  6. document.write("browser height = " + document.documentElement.clientHeight + "px.<br>");
  7. //document.write("browser height is " + document.body.clientHeight + "px.<br>");
  8. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.