Easy Tutorial
❮ Prop Element Nodename Dom Nodes ❯

XML DOM namespaceURI Property



Definition and Usage

The namespaceURI property returns the namespace URI of the selected element.

If the selected node is not an element or attribute, this property always returns NULL.

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books_ns.xml" into xmlDoc and retrieves the namespace URI from the first <title> element:

Example

xmlDoc = loadXMLDoc("books_ns.xml");
x = xmlDoc.getElementsByTagName("title")[0];
document.write(x.namespaceURI);

The above code will output:

http://www.tutorialpro.org/w3cnote/

❮ Prop Element Nodename Dom Nodes ❯