XML DOM 이름 속성
❮ DocumentType 객체
예시
다음 코드 조각은 " note_internal_dtd.xml "을 xmlDoc에 로드하고 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;
}
산출:
note
정의 및 사용
name 속성은 DTD의 이름(DOCTYPE 키워드 바로 다음에 오는 이름)을 반환합니다.
통사론
documentObject.doctype.name
❮ DocumentType 객체