Taille d'écran JavaScript
var w = window.innerWidth;
var h = window.innerHeight;
VasteMonde
var w = window.innerWidth;
var h = window.innerHeight;
const window {
width: window.innerWidth,
height: window.innerHeight
}
window.screen.height;
window.screen.width;
window.screen.width
//or just
screen.width
var win = window,
doc = document,
docElem = doc.documentElement,
body = doc.getElementsByTagName('body')[0],
x = win.innerWidth || docElem.clientWidth || body.clientWidth,
y = win.innerHeight|| docElem.clientHeight|| body.clientHeight;
alert(x + ' × ' + y);
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
"Screen width is " + screen.width;
</script>