javascript Element offsetHeight, offsetWidth

offsetHeight, offsetWidth NN 6 IE 4 DOM n/a  

 

Read-only  
 

Broadly speaking, provide the height and width of the element's content, but with minor variations with respect to element borders and padding among various operating system versions of IE and compatibility modes controlled by the DOCTYPE declaration. The trend is to include the measure of borders and padding, but not margins in these values. Implemented in Netscape 6 as a convenience, even though not part of the W3C DOM.

 
Example
 
var midpoint = document.getElementById("elementID").offsetWidth/2;
 
Value

Integer pixel count.

 
Default

Element-specific.


680,Nickname,Homepage or email,Comments here,Add comment