This width includes the padding but not border, vertical scroll-bar (if any), and the margin.
Note that we’re saying width of the entire content of an element! That means even the part of an element that is not viewable will be counted as part of the width.
Element scrollWidth Property Syntax:
Element scrollWidth Property Input Value
The scrollWidth property is read-only and so we can’t assign a value to it.
Element scrollWidth Property Return Value
The return value of this property, as mentioned before, includes the width of the content and padding of the target element. Again, this means the border, vertical scroll-bar, and margins won’t be included as part of the width.