Nome DOM XML Proprietà
❮ Oggetto TipoDocumento
Esempio
Il seguente frammento di codice carica " note_internal_dtd.xml " in xmlDoc e visualizza il nome del DTD:
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myFunction(this);
}
};
xhttp.open("GET", "note_internal_dtd.xml", true);
xhttp.send();
function myFunction(xml) {
var xmlDoc = xml.responseXML;
document.getElementById("demo").innerHTML =
xmlDoc.doctype.name;
}
Produzione:
note
Definizione e utilizzo
La proprietà name restituisce il nome del DTD (il nome immediatamente successivo alla parola chiave DOCTYPE).
Sintassi
documentObject.doctype.name
❮ Oggetto TipoDocumento