home ~ projects ~ socials

Get The Pixel Width And Height Of A Page In JavaScript

const width = document.documentElement.clientWidth;
const height = document.documentElement.clientHeight;

This gets the width and height of the window minus scrollbars

-- end of line --

References