![]() |
VOOZH | about |
The DOM scrollWidth property is used to return the width of an element. This property includes padding and also content that is not visible on the screen due to overflow but does not include a border, scrollbar, or margin. It is a read-only property.
Syntax:
element.scrollWidth
Return Value: It returns the width of the content of the element in pixels.
Example: In this example, we will use the scrollWidth property.
Output:
Supported Browsers: The browser supported by DOM scrollWidth property are listed below: