Summarized by others. I can't remember it, so I kept it.
Offsetwidth contains the width of the edge of the object
Width if you do not specify this value in the HTML code, the return value will be different. If width is set, the return value will be the same.
Widht returns 30px,Offsetwidth is the number 30.
// Obtain the height and width of the current window in Javascript
<Body> <script language = "JavaScript">
VaR S = "";
S + = "\ r \ n visible area width of the webpage:" + document. Body. clientwidth;
S + = "\ r \ n visible area of the webpage:" + document. Body. clientheight;
S + = "\ r \ n visible area width of the webpage:" + document. Body. offsetwidth + "(including the width of the edge and scroll bar )";
S + = "\ r \ n visible area height of the webpage:" + document. Body. offsetheight + "(including the width of the edge )";
S + = "\ r \ n webpage body full text width:" + document. Body. scrollwidth;
S + = "\ r \ n webpage text Height:" + document. Body. scrollheight;
S + = "\ r \ n webpage volume Height:" + document. Body. scrolltop;
S + = "\ r \ n left when the webpage is rolled:" + document. Body. scrollleft;
S + = "\ r \ n webpage body part:" + window. screentop;
S + = "\ r \ n left part of the webpage body:" + window. screenleft;
S + = "\ r \ n screen resolution Height:" + window. Screen. height;
S + = "\ r \ n screen resolution width:" + window. Screen. width;
S + = "\ r \ n available workspace Height:" + window. Screen. availheight;
S + = "\ r \ n available workspace width of the screen:" + window. Screen. availwidth;
S + = "\ r \ n your screen settings are" + window. Screen. colordepth + "bit color ";
S + = "\ r \ n your Screen Settings" + window. Screen. devicexdpi + "pixel/Inch ";
Alert (s );
</SCRIPT>
About the width offsetwidth availwidth scrollheight of an object