This article mainly introduces how to obtain webpage attributes by JS, including width and height. For more information, see
The Code is as follows:
Function getInfo ()
{
Var s = "";
S + = "visible area width of the webpage:" + document. body. clientWidth + "";
S + = "visible area height of the webpage:" + document. body. clientHeight + "";
S + = "visible area width of the webpage:" + document. body. offsetWidth + "(including the width of the edge and scroll bar)" + "";
S + = "visible area height of the webpage:" + document. body. offsetHeight + "(including the width of the edge)" + "";
S + = "webpage body full text width:" + document. body. scrollWidth + "";
S + = "webpage text Height:" + document. body. scrollHeight + "";
S + = "the height of the page to be rolled (ff):" + document. body. scrollTop + "";
S + = "high page volume (ie):" + document.doc umentElement. scrollTop + "";
S + = "Left of the webpage volume:" + document. body. scrollLeft + "";
S + = "webpage body part:" + window. screenTop + "";
S + = "webpage body part left:" + window. screenLeft + "";
S + = "screen Resolution height:" + window. screen. height + "";
S + = "screen Resolution width:" + window. screen. width + "";
S + = "available screen workspace Height:" + window. screen. availHeight + "";
S + = "available workspace width:" + window. screen. availWidth + "";
S + = "your screen settings are" + window. screen. colorDepth + "bit color" + "";
S + = "Your screen Settings" + window. screen. deviceXDPI + "pixels/inches" + "";
S + = "the actual height of the visible part of the window page (ff)" + window. innerHeight + "";
Alert (s );
};