Latest web development tutorials

XML DOM namespaceURI property

Attr Object Reference Attr objects

Definition and Usage

namespaceURI property sets or returns the property namespace URI.

grammar

attrObject.namespaceURI


Examples

The following code fragment uses loadXMLDoc () to " books_ns.xml " into xmlDoc and returns "lang" attribute namespace URI:

Examples

xmlDoc=loadXMLDoc("books_ns.xml");

x=xmlDoc.getElementsByTagName('book');

for(i=0;i<x.length;i++)
{
document.write(x.item(i).attributes[0].namespaceURI);
document.write("
");
}

The code above will output:

http://www.w3cschool.cc/children/
http://www.w3cschool.cc/xml/

try it"

Attr Object Reference Attr objects