Latest web development tutorials

XML DOM lookupNamespaceURI () method

Node Object Reference Node objects

Definition and Usage

lookupNamespaceURI () method returns the matching namespace node on a specified prefix URI.

grammar

nodeObject.lookupNamespaceURI(prefix)

参数 描述
prefix 必需。前缀。


Examples

The following code fragment uses loadXMLDoc () to " books_ns.xml " into xmlDoc, and look for the prefix "c" in the first <book> element belongs to the namespace URI:

Examples

xmlDoc=loadXMLDoc("books_ns.xml");

x=xmlDoc.getElementsByTagName("book")[0];
document.write(x.lookupNamespaceURI("c"));

Output:

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

try it"

Node Object Reference Node objects