W3cubDocs

/Web APIs

Document: implementation property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

The Document.implementation property returns a DOMImplementation object associated with the current document.

Value

A 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)

Warning: 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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
implementation 1 12 1 ≤12.1 1 18 4 ≤12.1 1 1.0 4.4 1

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Document/implementation