Compability: Internet Explorer
This property contains the name of the document type; i.e., the name that immediately follows the 'DOCTYPE' keyword.
In this example we use the 'staff.xml' file which has the following DOCTYPE declaration: !DOCTYPE staff SYSTEM "staff.dtd" The code then returns the name property of the DocumentType.
xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;
xml_doc.load("staff.xml");
d_type = xml_doc.doctype;
document.write(d_type.name);
staff
In this example we use the 'staff.xml' file which has the following DOCTYPE declaration: <!DOCTYPE staff SYSTEM "staff.dtd"> The code then returns the name property of the DocumentType.