This finds actual physical screen size that does not change
1 2 3 4 5 6 |
<script> alert(window.screen.availWidth); alert(window.screen.availHeight); </script> |
But this finds what screen size you have shown at the present moment. you can change your screen size (reduce browser then try again and it will be different)
1 2 3 4 5 6 7 8 9 10 |
<script> var w = window.innerWidth; var h = window.innerHeight; alert(w); alert(h); </script> |