Latest web development tutorials

XML DOM lookupNamespaceURI () method

Element Object Reference Element object

Definition and Usage

lookupNamespaceURI () method returns the specified namespace prefix match on the current node.

grammar

elementNode.lookupNamespaceURI(prefix)

参数 描述
prefix 必需。字符串,规定要查找的前缀。


Examples

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

Examples

xmlDoc=loadXMLDoc("books_ns.xml");

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

document.write(x.lookupNamespaceURI("c"));

Output:

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

try it"

Element Object Reference Element object