setAttributeNode method
Sets an IHTMLDOMAttribute2 interface node as part of the object.
![]() |
Syntax
HRESULT retVal = object.setAttributeNode(pattr, ppretAttribute);
Parameters
- pattr [in]
-
Type: IHTMLDOMAttribute
Pointer to the IHTMLDOMAttribute2 interface to be assigned. - ppretAttribute [out, retval]
-
Type: IHTMLDOMAttribute
Address of a pointer variable that receives the assigned IHTMLDOMAttribute2 pointer.
Exceptions
| Exception | Condition |
|---|---|
|
Raised if pattr was created from a different document than the calling element's parent document. Versions earlier than Internet Explorer 10 will throw the exception as WRONG_DOCUMENT_ERR. |
|
Raised if a read only attribute already exists with the same IHTMLDOMAttribute2::name as pattr. Versions earlier than Internet Explorer 10 will throw the exception as NO_MODIFICATION_ALLOWED_ERR. |
|
Raised if pattr is already assigned to an element object. Versions earlier than Internet Explorer 10 will throw the exception as INUSE_ATTRIBUTE_ERR. |
Standards information
Remarks
IHTMLElement4::setAttributeNode was introduced in Microsoft Internet Explorer 6.
Show:
