Element.scrollTopMax is a read-only number: the maximum top scroll offset possible for the element (MDN). Where supported, it is the largest value scrollTop can normally reach.
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use el.scrollTopMax. Start with this line.
JavaScript
element.scrollTopMax
Call
What it does
element.scrollTopMax
Primary signature.
Built into the browser. Read or assign el.scrollTopMax — no import required.
Library declarations
JavaScript
element.scrollTopMax
Parameters
Parameter
Description
Scroll container
Required. Element that can scroll vertically
scrollHeight / clientHeight
Required. Standard way to compute the max
scrollTopMax
Optional. Firefox helper — feature-detect only
Return Value
Return Value
Description
*
Number (max top scroll offset)
JavaScript Examples
Example 1 — Portable Max
Compute the maximum vertical offset with standard properties.
Result. The box jumps near the bottom of the content.
Note. You assign to scrollTop, never to scrollTopMax.
Compatibility
Browser Support
Element.scrollTopMax is marked Non-standard on MDN and is not part of any specification. Support is limited (mainly Firefox). Prefer scrollHeight - clientHeight for portable code.
✓ Non-standard · Limited
Element.scrollTopMax
Read-only maximum vertical scroll offset — Firefox-oriented, not for production cross-browser use.
LimitedNon-standard
Mozilla FirefoxSupported (non-standard)
Yes
Google ChromeNot available — use scrollHeight - clientHeight
No
Microsoft EdgeNot available — use scrollHeight - clientHeight
No
Apple SafariNot available — use scrollHeight - clientHeight
No
OperaNot available — use scrollHeight - clientHeight
No
Internet ExplorerNot available
No
scrollTopMaxLimited
Bottom line: Feature-detect if you inspect scrollTopMax in Firefox. For shipping UI, use scrollHeight - clientHeight.
Frequently Asked Questions
Where supported, it returns a read-only number: the maximum top scroll offset possible for the element — the largest value scrollTop can normally reach.
MDN marks Element.scrollTopMax as Non-standard. It is not part of any specification. It is not labeled Deprecated or Experimental, but MDN does not recommend non-standard features for production.
Support is limited — mainly Firefox. Chrome, Safari, and Edge typically do not expose scrollTopMax.
Prefer the portable calculation element.scrollHeight - element.clientHeight for the maximum vertical scroll offset across browsers.
No. It is read-only. Read the maximum, then assign to scrollTop if you want to move the scrollbar.
scrollTop is the current vertical offset and is writable. scrollTopMax is the maximum possible offset and is read-only (where supported).