createElementNS method
Creates an element from the specified namespace.
![]() ![]() |
Syntax
var newElem = document.createElementNS(pvarNS, bstrTag);Parameters
- pvarNS [in]
-
Type: Variant
A String value that specifies the URI of the desired namespace.
- bstrTag [in]
-
Type: String
A String value that contains the name of the desired element.
- newElem [out, retval]
-
Type: HTMLElement
A reference to the HTMLElement object that contains the new element.
Return value
Type: HTMLElement
A reference to the HTMLElement object that contains the new element.
Standards information
Remarks
The createElementNS method is supported only for XML namespaces.
Examples
The following code example creates a circle element from the SVG namespace.
var sNamespace = "http://www.w3.org/2000/svg"; var oCircle = document.createElementNS( sNamespace, "circle" );
See also
Show:

