XML DOM name Property
DocumentType Object
Example
The following code fragment loads "note_internal_dtd.xml" into xmlDoc and displays the name of the DTD:
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
myFunction(xhttp);
}
};
xhttp.open("GET", "note_internal_dtd.xml", true);
xhttp.send();
function myFunction(xml) {
var xmlDoc = xml.responseXML;
document.getElementById("demo").innerHTML =
xmlDoc.doctype.name;
}
Output:
note
Try it Yourself »
Definition and Usage
The name property returns the name of the DTD (the name immediately following the DOCTYPE keyword).
Syntax
documentObject.doctype.name
DocumentType Object