ScrollWidth
It is the width of the actual content of the object. The width of the content in the object varies with the number of elements in the object. If the content is too large, the actual width of the object may be changed ).
ClientWidth
It is the visible width of the object. If it is not set to the same side of the scroll bar, it will change with the display size of the window.
OffsetWidth
Is the visible width of the object. The package's scroll bar and other edges change with the display size of the window.
An example of scrollWidth and clientWidth:
<Html>
Enter the content in the text box. The value of scrollWidth and clientWidth is the same before the horizontal scroll bar does not come out. When a row of content exceeds the width of the text box, a horizontal scroll bar is displayed, and the value of scrollWidth is changed.
ScrollWidth is the width of the object content.
ClientWidth is the width (excluding the edge) seen by the object, which will not be changed in this example.
An example of clientWidth and offsetWidth:
<Html>
The value of offsetWidth is always greater than that of clientWidth.
ClientWidth is the width (excluding the edge) seen by the object)
OffsetWidth is the width seen by the object (including the edge, such as the width occupied by the scroll bar)
Ps:
Wrap = "virtual"Automatic line feed is implemented in the text area to improve user display. However, when transmitted to the server, the text is wrapped only when the user presses the Enter key, there is no line feed effect elsewhere.
Wrap = "physical"It implements automatic line breaks in the text area and transmits them to the server in this form, just as the user actually typed. Because text needs to be transmitted to the server based on the effect you see in the text area, it is very useful to use automatic line breaks.
If you set wrapOffTo obtain the default action.
Difference between scrollWidth, clientWidth and offsetWidth