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 (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;
}

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
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.