Programmer's Guide > Interfaces > W3C Document interface > createElementNS method
  
createElementNS method
Creates an element of the given qualified name and namespace URI. HTML-only DOM implementations do not need to implement this method.
createElementNS(namespaceURI, qualifiedName )
Parameters
StringnamespaceURI
The namespace URI of the element to create.
StringqualifiedName
The qualified name of the element type to instantiate.
Returns
Element. A new Element object with the following attributes:
Node.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted from qualifiedName, or null if there is no prefix
Node.localName
local name, extracted from qualifiedName
Element.tagName
qualifiedName
Throws
DOMException
INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character.
NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace" [XML Namespaces].