Abakada HTML Demo: scrollWidth Property


This example demonstrates use of the scrollWidth property to retrieve the width of the viewable content.

The scrollWidth property is read-only, allowing you to obtain the width actually needed in the scrolling. Even though the width of this DIV is set to 200, the width inside the scrolling text box may be more, since the wrapping of the text is disabled. This dimension may be useful for a variety of reasons; for example, the width of the DIV could be set to the scrollWidth to conserve horizontal space while respecting the set width as a maximum.


View Source   Exit

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.