js screen resolution code example Example: javascript screen size var w = window.innerWidth; var h = window.innerHeight;