XML DOM lookupPrefix() Method
Complete Element Object Reference
Definition and Usage
The lookupPrefix() method returns the prefix matching the
specified namespace URI on the current node.
Syntax
elementNode.lookupPrefix(URI)
|
| Parameter |
Description |
| URI |
Required. The namespace URI for the prefix to find |
Example
The following code fragment loads "books_ns.xml"
into xmlDoc using
loadXMLDoc() and finds the prefix for a namespace URI in the
first
<book> element:
xmlDoc=loadXMLDoc("books_ns.xml");
x=xmlDoc.getElementsByTagName("book")[0];
document.write(x.lookupPrefix("http://www.w3schools.com/children/"));
|
Output:
Try-It-Yourself Demos
lookupPrefix() - Get a prefix by namespace
Complete Element Object Reference
Want To Be A Web Master?
If you want to be a Web Master, you will have to host your web site with an ISP (Internet Service Provider).
MaximumASP offers seven different configurations of dedicated servers to meet your Windows and .NET hosting needs.
Hosted on our multi-tiered Enterprise Class network, these servers provide the performance, security and reliability
you need to host your high end web sites and applications.
Visit MaximumASP
|