Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets the value of the specified attribute.
![]() |
Syntax
HRESULT retVal = object.setAttribute(strAttributeName, AttributeValue);
Parameters
strAttributeName [in]
Type: BSTRBSTR that specifies the name of the attribute.
AttributeValue [in]
Type: VARIANTVariant that specifies the string, number, or Boolean to assign to the attribute.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
If the specified attribute is not already present, the IHTMLElement5::setAttribute method adds the attribute to the object and sets the value.
See also
Reference
Conceptual