XML DOM prefix attribute
Definition and Usage
prefix property returns the namespace prefix of the selected element.
If the selected node is not an element or attribute, the property always returns NULL.
grammar
elementNode.prefix
Examples
The following code fragment uses loadXMLDoc () to " books_ns.xml " into xmlDoc and obtain namespace prefix from the first <title> element:
Examples
xmlDoc=loadXMLDoc("books_ns.xml");
x=xmlDoc.getElementsByTagName("title")[0];
document.write(x.prefix);
x=xmlDoc.getElementsByTagName("title")[0];
document.write(x.prefix);
The code above will output:
c
try it"
Element object