XML DOM prefix attribute
Definition and Usage
prefix property sets or returns the property namespace prefix.
grammar
attrObject.prefix
Examples
The following code fragment uses loadXMLDoc () to " books_ns.xml " into xmlDoc and returns "lang" attribute namespace prefix:
Examples
xmlDoc=loadXMLDoc("books_ns.xml");
x=xmlDoc.getElementsByTagName('title');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).attributes[0].prefix);
document.write("
");
}
x=xmlDoc.getElementsByTagName('title');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).attributes[0].prefix);
document.write("
");
}
The code above will output:
c
x
x
try it"
Attr objects