XML DOM ownerDocument गुण
व्याख्या और उपयोग
ownerDocument गुणवत्ता नोड के मूल एलीमेंट (}}Document वस्तु)。
व्याकरण:
attrObject.ownerDocument
उदाहरण
सभी उदाहरणों में, हम XML फ़ाइल का इस्तेमाल करेंगे books.xmlके साथ-साथ JavaScript फ़ंक्शन loadXMLDoc()。
निम्नलिखित कोड खण्ड XML डॉक्यूमेंट में पहले category गुणवत्ता नोड के मूल एलीमेंट को वापस करता है:
xmlDoc=loadXMLDoc("/example/xdom/books.xml"); x=xmlDoc.getElementsByTagName('book'); document.write(x.item(0).attributes[0].ownerDocument
); document.write("<br />"); document.write(x.item(0).attributes[0].ownerDocument.nodeName
); document.write("<br />"); document.write(x.item(0).attributes[0].ownerDocument.nodeType
);
इस कोड का आउटपुट निम्नलिखित है:
[object XMLDocument] #document 9