0 votes
in JavaScript by
What are the properties used to get size of window?

1 Answer

0 votes
by

You can use innerWidth, innerHeight, clientWidth, clientHeight properties of windows, document element and document body objects to find the size of a window. Let's use them combination of these properties to calculate the size of a window or document,

var width =
  window.innerWidth ||
  document.documentElement.clientWidth ||
  document.body.clientWidth;

var height =
  window.innerHeight ||
  document.documentElement.clientHeight ||
  document.body.clientHeight;

Related questions

0 votes
asked Oct 13, 2023 in JavaScript by GeorgeBell
0 votes
asked Oct 13, 2023 in JavaScript by GeorgeBell
...