get window size javascript
snippet in javascript

get window size javascript

user8120

const window {
  width: window.innerWidth,
  height: window.innerHeight
}

get screen width javascript

user1640

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

js window dimensions

user3236

// better than using window.innerWidth / window.innerHeight 
// because of scrollbars
const client = {
      width: document.documentElement.clientWidth,
      height: document.documentElement.clientHeight
}

java script find screen size of device

user9599

// Size of browser viewport.
$(window).height();
$(window).width();

// Size of HTML document (same as pageHeight/pageWidth in screenshot).
$(document).height();
$(document).width();

js know size of screen displayed

user6341

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);

get window height javascript

user5995

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

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