How can I constantly get the width and the height of the browser via javascript? Simply using document.body.clientWidth
or window.innerWidth
gives the width once the page is loaded.
However, how can one obtain the width and height updated whenever the user resizes the window?