how to get the height of window in javascript
snippet in javascript

how to get the height of window in javascript

user3389

//get screen height of the device by using
window.innerHeight
//get screen width of the device by using
window.innerWidth

get screen width javascript

user6877

window.screen.width
//or just
screen.width

get window height javascript

user3084

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = 
"Screen width is " + screen.width;
</script>