Gets a reference to the currentStyle object, which represents the current cascaded format and style specified by global style sheets, inline styles, and HTML attributes.
HRESULT IHTMLElement2::get_currentStyle(IHTMLCurrentStyle **p);
- Address of a pointer to a variable of type IHTMLCurrentStyle interface that receives the cascaded style of the object.
Returns one of the following values.
S_OK The operation completed successfully. W3CException_DOM_NO_MODIFICATION_ALLOWED_ERR An attempt is made to modify an object that cannot be changed.
The values returned by the properties of the IHTMLStyle and IHTMLCurrentStyle interfaces differ when the style of an object is not set inline. For example, if the author of a Web page sets the color property of a paragraph to
redonly through a linked or embedded style sheet, and not inline, then the IHTMLCurrentStyle::color property returns the value
red, and the IHTMLStyle::get_color property does not return a value. However, if the author specifies the value of the color property inline, as in the following example, both the IHTMLCurrentStyle::color and IHTMLStyle::get_color properties return the value
In Windows Internet Explorer 8 and earlier, the IHTMLElement2::currentStyle property returns E_MEMBERNOTFOUND if script attempts to write to it.