Document: implementation property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{ ApiRef("DOM") }}
The **implementation** read-only property of the {{domxref("Document")}} interface returns a {{domxref("DOMImplementation")}} object associated with the current document.
Value
A {{domxref("DOMImplementation")}} object.
Examples
const modName = "HTML";
const modVer = "2.0";
const conformTest = document.implementation.hasFeature(modName, modVer);
console.log(`DOM ${modName} ${modVer} supported?: ${conformTest}`);
// Log: "DOM HTML 2.0 supported?: true" (hasFeature always returns true)توجه: Do not use this for feature detection. The hasFeature() method always returns true.
Notes
The W3C's DOM Level 1 Recommendation only specified the hasFeature method, which is one way to determine if a DOM module is supported by a browser (see example above and What does your user agent claim to support?). If available, other DOMImplementation methods provide services for controlling things outside of a single document. For example, the DOMImplementation interface includes a createDocumentType method with which DTDs can be created for one or more documents managed by the implementation.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}