Javascript Reference
Categories: document

javascript document height, width

@March 15, 2008, 1:22 a.m.
height, width Firefox/Netscape/NN 4 IE n/a Chrome/Safari/DOM n/a

Read-only

Return the pixel dimensions of the entire rendered document. These values coincide with the offsetHeight and offsetWidth property values for the document.body object. Since neither property pairing is yet sanctioned by the W3C DOM, you might prefer the offset pair, because they are at least cross-browser compatible.

 
Example
 
var howTall = document.height;
 
Value

Number of pixels.

 
Default

Current document size.


Powered by Linode.