createAttribute
TOC
Collapse the table of content
Expand the table of content

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]

Type: String

A String that sets the attribute object's name.

Return value

Type: IHTMLDOMAttribute

Returns a reference to the new attribute object.

Exceptions

ExceptionCondition
InvalidCharacterError
5

If the specified name contains an illegal character. Versions earlier than a Windows Store app using JavaScript 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.

See also

document

 

 

Show:
© 2016 Microsoft