documentbodyscrollTop
Document.body.scrollTop is a property of the body element that reports the vertical scroll offset of the document in pixels. It indicates how far the page has been scrolled from the top and can be written to in some browsers to influence the scroll position.
Cross-browser behavior for the document’s scroll position is inconsistent. In standards-compliant mode, many browsers reflect the
To reliably obtain the vertical offset across browsers, a common approach is to use a fallback chain
For changing the scroll position, the preferred method is to use scrolling APIs rather than assigning to
In modern web development, window.pageYOffset and window.scrollTo (or the newer scrollTo options) are the standard tools
See also: pageYOffset, scrollTop, documentElement, window.scrollTo.
---