Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IHTMLDOMAttribute2::attributes Property

Retrieves a collection of attributes of the object.


HRESULT IHTMLDOMAttribute2::get_attributes(IDispatch **p);


Address of a pointer to a variable of type IDispatch interface that receives a zero-based array of attributes applied to the object.

Return Value

Returns S_OK if successful, or an error value otherwise.


The IHTMLDOMAttribute2::expando properties of an object are included in the IHTMLElement5::attributes collection of the object as of Microsoft Internet Explorer 6. To access the expando properties of an object in earlier versions of Windows Internet Explorer, use the Microsoft JScript  for...in construct.

The attributes collection does not expose the style object. Use the cssText property of the object's style property to retrieve the persistent representation of the cascading styles associated with an object.

Unlike other Dynamic HTML (DHTML) collections, such as all and children, the attributes collection is static. Modifications to the properties of an object are not automatically reflected by an existing reference to the attributes collection of that object.

Community Additions

© 2015 Microsoft