XML DOM createAttributeNS() method

Document object reference manual

Definition and usage

Create an Attr node with the specified name and namespace.

Syntax:

createAttributeNS(uri,name)
Parameters Description
uri The unique identifier of the namespace of the Attr. It is null if there is no namespace.
name The qualified name of the attribute, which should include the namespace prefix, colon, and local name.

Return value

Returns the newly created Attr node with the specified name and namespace.

Description

createAttributeNS() method with createAttribute() methodSimilar, but the Attr node created by it has the specified name and namespace in addition to the specified name. This method is only used by XML documents that use namespaces.

Document object reference manual