Because the style values are cascaded from style sheet to style sheet and may include some inline styles as well as some explicit styles, objects need to maintain a current style value that is the result of all the inheritances applied on top of one another.
In addition they maintain a run-time style which reflects dynamic changes as well. The run-time style is based on the current style in the first place.
The value of this property is a reference to a style object. However it does not refer to the same style object as the style property. You can test for this with the isObjectEqual() function that we have covered elsewhere.
Note that in MSIE, the object that is returned is of the class "style" rather than "Style". The upper and lower case spelling may differ between browsers. However since you are likely to access the object by reference you may never need to know the specific class name.
Prev | Home | Next |
Element.contentEditable | Up | Element.dir |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |