nodeType

XML DOM nodeType xususiyati


❮ Node obyekti

Misol

Quyidagi kod fragmenti "books.xml" faylini xmlDoc’ga yuklaydi va ildiz tugunning tugun nomi hamda tugun turini ko‘rsatadi:

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 + ")"; }

Yuqoridagi kodning natijasi quyidagicha bo‘ladi:

Nodename: #document (nodetype: 9)
O‘zingiz sinab ko‘ring »

Ta’rif va qo‘llanilishi

nodeType xususiyati tugunning tugun turini qaytaradi.


Sintaksis

nodeObject.nodeType

❮ Node obyekti

W3Schools Pathfinder

Yutuqlaringizni kuzating – bu bepul!