The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
createAttribute method
Creates an attribute object with a specified name.
![]() |
Syntax
var ppattribute = document.createAttribute(bstrattrName);Parameters
- bstrattrName [in]
-
C++ A String that sets the name property. JavaScript A String that sets the attribute object's name. - ppattribute [out, retval]
-
C++ A pointer variable that receives an IHTMLDOMAttribute2 pointer. JavaScript Returns a reference to the new attribute object.
Return value
Type: IHTMLDOMAttribute
Returns a reference to the new attribute object. A pointer variable that receives an IHTMLDOMAttribute2 pointer.Exceptions
| Exception | Condition |
|---|---|
|
If the specified name contains an illegal character. Versions earlier than Internet Explorer 10 will throw the exception as INVALID_CHARACTER_ERR. |
Standards information
Remarks
This method will fail if the bstrattrName parameter value contains invalid (non-Unicode Transformation Format (UTF)-16) characters.
createAttribute was introduced in Microsoft Internet Explorer 6.
See also
Show:
