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