XML DOM specified ιδιότητα
Ορισμός και χρήση
Αν έχει ρυθμιστεί η τιμή της ιδιότητας στο έγγραφο specified
Η ιδιότητα επιστρέφει true αν είναι η προεπιλεγμένη τιμή του DTD/Schema, αλλιώς επιστρέφει false.
Γλώσσα
attrObject.specified
Παράδειγμα
Τα παρακάτω κώδικες θα φορτώσουν το "books.xml" στον xmlDoc και θα εμφανίσουν το όνομα και την τιμή της ιδιότητας category:
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 x, i, xmlDoc, txt; xmlDoc = xml.responseXML; txt = "" x = xmlDoc.getElementsByTagName('book'); για (i = 0; i < x.length; i++) { txt += x.item(i).attributes[0].specified + "<br>"; {} document.getElementById("demo").innerHTML = txt; {}