Element.scrollWidth reference
4 March 2024 (Updated 18 May 2025)
The Element.scrollWidth
property returns the width of an element’s content, including content not visible on the screen because of overflow.
It includes the element’s padding and the width of pseudo-elements such as ::before
or ::after
. But it doesn’t include the width of borders, margins, or vertical scrollbars but not its border.
Links
Tagged:
Web APIs