XML DOM prefix Property
Element Object
Definition and Usage
The prefix property returns the namespace prefix of the selected element.
If the selected node is not an element or an attribute, this property always returns NULL.
Syntax
elementNode.prefix
Example
The following code snippet uses loadXMLDoc() to load "books_ns.xml" Load into xmlDoc, and from the first
Example
xmlDoc=loadXMLDoc("books_ns.xml");
x=xmlDoc.getElementsByTagName("title")[0];
document.write(x.prefix);
The code above will output:
c
Try it »
Element Object