X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

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


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook