Return the width of the document and window elements How to return the current width of the document and window elements.
Instead, use document.body.clientWidth.
The width and height properties of the getBoundingClientRect () method will Document.height Deprecated: This feature is no longer recommended. The width property has effect only on block-level elements or on elements with absolute or fixed position. Get document size without jQuery.
element of the current document in pixels.