IHTMLElement::className Property

Sets or retrieves the class of the object.


HRESULT IHTMLElement::get_className(BSTR *p);HRESULT IHTMLElement::put_className(BSTR v);


Pointer to a variable of type BSTR that receives the class or style rule.
BSTR that specifies the class or style rule.

Return Value

Returns S_OK if successful, or an error value otherwise.


The class is typically used to associate a particular style rule in a style sheet with the element .

By default, the property is equal to the string assigned to the IHTMLElement::className property of the given object, or NULL if the attribute is not explicitly assigned.

In Windows Internet Explorer 8, class names, such as hslice and entry-title, are used to identify portions of a webpage that can be monitored for updates ( Web Slices). For more information, see Subscribing to Content with Web Slices.