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

XML DOM namespaceURI Property

XML DOM namespaceURI Property


Element Object Reference Element Object


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

elementNode.namespaceURI


Example

The following code snippet uses loadXMLDoc() to load "books_ns.xml" Load into xmlDoc, and from the first get the namespace URI of an element: </p>

Example

xmlDoc=loadXMLDoc("books_ns.xml");

x=xmlDoc.getElementsByTagName("title")[0];

document.write(x.namespaceURI);

The code above will output:

http://www.runoob.com/w3cnote/

Try it »


Element Object Reference Element Object