XML DOM ownerElement ÊôÐÔ

¶¨ÒåºÍÓ÷¨

ownerElement ÊôÐÔ·µ»Ø attribute Ëù¸½ÊôµÄÔªËØ½Úµã¡£

Óï·¨£º

attrObject.ownerElement

ʵÀý

ÔÚËùÓеÄÀý×ÓÖУ¬ÎÒÃǽ«Ê¹Óà XML Îļþ books.xml£¬ÒÔ¼° JavaScript º¯Êý loadXMLDoc()¡£

ÏÂÃæµÄ´úÂëÆ¬¶Î·µ»ØµÚÒ»¸ö category ÊôÐÔËù¸½ÊôµÄÔªËØ£º

xmlDoc=loadXMLDoc("/example/xdom/books.xml");

x=xmlDoc.getElementsByTagName('book');

document.write(x.item(0).attributes[0].ownerElement);
document.write("<br />");
document.write(x.item(0).attributes[0].ownerElement.nodeName);
document.write("<br />");
document.write(x.item(0).attributes[0].ownerElement.nodeType);

ÒÔÉÏ´úÂëµÄÊä³ö£º

[object Element]
book
1
VUE