Windows apps
Collapse the table of content
Expand the table of content
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.

createElementNS method

Creates an element from the specified namespace.

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

 

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

document

 

 

Show:
© 2017 Microsoft