Document.doctype
< JavaScript | Document
اذهب إلى التنقل
اذهب إلى البحث
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
تُعيد تعريف نوع المُستند (DTD) المُرتبط بالمُستند الحاليّ. الكائن المُعاد يُطبّق الواجهة DocumentType
. استعمل DOMImplementation.createDocumentType()
لإنشاء الواجهة DocumentType
.
البنية العامّة
doctype = document.doctype;
doctype
خاصيّة قابلة للقراءة فقط.
مثال
var doctypeObj = document.doctype;
console.log(
"doctypeObj.name: " + doctypeObj.name + "\n" +
"doctypeObj.internalSubset: " + doctypeObj.internalSubset + "\n" +
"doctypeObj.publicId: " + doctypeObj.publicId + "\n" +
"doctypeObj.systemId: " + doctypeObj.systemId
);
ملاحظات
تُعيد الخاصيّة القيمة null
في حالة لم يكن هناك أي تعريف نوع مستند (DTD) مرتبط بالمستند الحالي.
المستوى الثّاني من DOM لا يدعم تعديل تعريف نوع المستند.
مصادر ومواصفات
- مواصفة DOM: Document Object Model (DOM) Level 3 Core Specification. غيّرت هذه المواصفة القيمة المُعادة لمستندات HTML التي لا تحتوي على عنصر
<html>
. أضافت إمكانيّة تغيير نوع المُستند. - مواصفة Document Object Model (DOM) Level 2 Core Specification. التعريف البدئي.