HTML DOM namespaceURI Property
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





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