Element.currentStyle (Property)

A reference to a style object that contains the current style settings for the Element object.

Availability:

JScript - 5.0
Internet Explorer - 5.0
Property/method value type:Style object
JavaScript syntax:IEmyElement.currentStyle
IEmyElement.currentStyle = aStyleObject
Argument list:aStyleObjectA new style object to associate with the element

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.

Warnings:

See also:currentStyle object, Element object, Element.runtimeStyle, Element.style, isObjectEqual(), runtimeStyle object, style object (2)