Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM namespaceURI Property

HTML DOM namespaceURI Property

Element Object Reference Element object

Example

Return the namespace URI of the XHTML document:

document.documentElement.namespaceURI;

Output result:

http://www.w3.org/1999/xhtml

Try it »


Definition and Usage

The namespaceURI property returns the namespace URI for the selected node.

**Note:** Element nodes inherit the namespace of the parent node, therefore all elements in an XHTML document have the namespace URI "http://www.w3.org/1999/xhtml".


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the namespaceURI property

Note: Internet Explorer 8 and earlier IE versions do not support this attribute.


Syntax

node

.namespaceURI

Technical Details

Return Value: String, representing the namespace URI of the node.
DOM version Core Level 2 Node Object

Element Object Reference Element object