Information
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.

Document Object Model (DOM) Level 3 Core Specification, Section 1.4

 

Syntax

var ppattribute = document.createAttribute(bstrattrName);

Parameters

bstrattrName [in]
C++A String that sets the name property.
JavaScriptA 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

ExceptionCondition
InvalidCharacterError
5

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

document

 

 

Show:
© 2014 Microsoft