خصائص XML DOM nodeValue
التعريف والاستخدام
nodeValue
تعيين أو رجوع قيمة العنصر بناءً على نوعه.
النص
nodeObject.nodeValue
مثال
الخطوط التالية ستقوم بتحميل "books.xml" إلى xmlDoc وعرض اسم العنصر الجذر و قيمته:
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 + (value: " + xmlDoc.childNodes[0].nodeValue) + ")"; }