How to Get Current Screen Size
- Previous Page Get Current URL
- Next Page Get iframe Element
Learn how to use JavaScript to get the current screen/browser window size.
current screen size
using window.innerWidth
and window.innerHeight
to get the current screen size of the page.
This example shows the height and width of the browser window (excluding the toolbar/scroll bar):
Example
var w = window.innerWidth; var h = window.innerHeight;
Related Pages
Reference Manual:JavaScript Window Object
- Previous Page Get Current URL
- Next Page Get iframe Element