Document.width (Property)

The width of the document.

Availability:

JavaScript - 1.2
Netscape - 4.0
Property/method value type:Number primitive
JavaScript syntax:NmyDocument.body.offsetWidth
NmyDocument.width

The current width of the document measured in pixels. This value constantly changes as the document content is rendered into the page. You can measure this value during document loading and then measure it later to find the page has grown in size.

On MSIE, this property is not supported and you need to do a little work to access the appropriate Element object properties of the body object.

Warnings:

See also:Document object, Document.height

insert figure 0055