THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML DOM namespaceURI Property

Element Object Reference Element Object

Example

Get the URI of the namespace for an XHTML document:

var x = document.documentElement.namespaceURI;

The result of x will be:

http://www.w3.org/1999/xhtml
Try it yourself »

Definition and Usage

The namespaceURI property returns the URI of the specified node's namespce.

Note: An element node inherits the namespace of its parent node, therefore, all elements in an XHTML document has the namespaceURI "http://www.w3.org/1999/xhtml".

This property is read-only.


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
namespaceURI Yes 9.0 Yes Yes Yes

Syntax

node.namespaceURI

Technical Details

Return Value: A String, representing the URI of the node's namespace, or null if the node is not in a namespace
DOM Version Core Level 2 Node Object

Related Pages

HTML DOM reference: node.isDefaultNamespace() Method


Element Object Reference Element Object