XML DOM nodeName Property
❮ စာရွက်စာတမ်းအရာဝတ္ထု
ဥပမာ
အောက်ဖော်ပြပါ ကုဒ်အပိုင်းအစသည် " books.xml " ကို xmlDoc တွင် တင်ပြီး root node ၏ node အမည်နှင့် node အမျိုးအစားကို ပြသသည်-
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myFunction(this);
}
};
xhttp.open("GET", "books.xml", true);
xhttp.send();
function myFunction(xml) {
var xmlDoc = xml.responseXML;
document.getElementById("demo").innerHTML =
"Nodename:
" + xmlDoc.nodeName +
" (nodetype: " + xmlDoc.nodeType
+ ")";
}
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
Nodename: #document (nodetype: 9)
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
nodeName ပိုင်ဆိုင်မှုသည် ၎င်း၏အမျိုးအစားပေါ် မူတည်၍ node တစ်ခု၏အမည်ကို ပြန်ပေးသည်။
အထားအသို
documentObject.nodeName
ကိုယ်တိုင်စမ်းသုံးကြည့်ပါ-ဒီမိုများ
❮ စာရွက်စာတမ်းအရာဝတ္ထု