Latest web development tutorials

XML DOM baseURI property

Element Object Reference Element object

Definition and Usage

baseURI property returns xml document's location (URI).

grammar

elementNode.baseURI


Examples

The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc, showing the location of the XML document:

Examples

xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName("book")[0];

document.write("Document location: " + x.baseURI);

Output:

Document location: http://www.w3cschool.cc/dom/books.xml

try it"

Element Object Reference Element object