The HTML dialog element works in Chrome 37+, Edge 79+, Firefox 98+, Safari 15.4+, Opera 24+, Samsung Internet 4+. See methods, attributes, and known issues.

Prince Dewani
May 6, 2026
The HTML <dialog> element is a WHATWG element that shows a modal or non-modal dialog box, with showModal(), show(), and close() methods plus a ::backdrop pseudo-element. It works in Chrome 37+, Edge 79+, Firefox 98+, Safari 15.4+, Opera 24+, and Samsung Internet 4+, while Internet Explorer and Opera Mini never added support.
This guide covers what the dialog element is, the browsers that support it, the key features, known issues, opening and closing it, and how it compares to popover.
The HTML <dialog> element is an interactive element from the WHATWG HTML Living Standard that shows a dialog box on a web page. It supports a modal mode through showModal(), a non-modal mode through show(), and a close() method, and modal dialogs paint in the top layer with a ::backdrop pseudo-element.
The HTML <dialog> element works in every modern desktop and mobile browser, but support starts at very different versions across vendors and was disabled by default in Chrome and Firefox for many releases before becoming a stable feature.
Chrome supports the <dialog> element from Chrome 37 on Windows, macOS, Linux, ChromeOS, and Android. Chrome 32 to 36 had it disabled by default behind the Experimental Web Platform Features flag, and Chrome 4 to 31 did not support it. The closedby attribute and the :open pseudo-class work from Chrome 134 on.
Microsoft Edge supports the <dialog> element from Edge 79 on Windows, macOS, and Linux. Legacy EdgeHTML 12 to 18 did not support the element. Chromium-based Edge 79 and later inherits every Chrome dialog feature, including showModal(), the ::backdrop pseudo-element, and form method="dialog" submission.
Firefox supports the <dialog> element from Firefox 98 on Windows, macOS, Linux, and Android. Firefox 53 to 97 had it disabled by default behind the dom.dialog_element.enabled preference, and Firefox 2 to 52 did not support it. Firefox 137 added the closedby attribute and the :open pseudo-class.
Safari supports the <dialog> element from Safari 15.4 on macOS Monterey and from iOS Safari 15.4 on iPhone and iPad. Safari 3.1 to 15.3 on macOS and iOS Safari 3.2 to 15.3 did not support the element. Safari 18.2 added the closedby attribute on macOS, iOS, and iPadOS.
Opera supports the <dialog> element from Opera 24 on Windows, macOS, and Linux. Opera 19 to 23 had it disabled by default behind a flag, and Opera 9 to 18 did not support it. Chromium-based Opera 15 and later tracks every Chrome dialog feature, while Opera Mini never added support and falls back to a generic block element.
Samsung Internet supports the <dialog> element from Samsung Internet 4.0 on Galaxy phones and tablets. Samsung Internet inherits the Chromium dialog stack, so showModal(), show(), close(), the ::backdrop pseudo-element, and form method="dialog" all work the same way they do in desktop Chrome.
Modern Chrome for Android replaced the stock Android Browser on Android 4.4 and later, so <dialog> works on every shipping Android device through Chrome for Android 37 and later. The legacy Android Browser 2.1 to 4.4.4 did not support the element. KaiOS Browser 2.5 and 3 also do not support it and fall back to a generic block element.
Internet Explorer never supported the <dialog> element. Internet Explorer 5.5 to 11 render the markup as a generic block-level element with no top-layer behaviour, no modal mode, and no ::backdrop. Microsoft has retired Internet Explorer, so move IE-only dialogs to Chromium Edge or use a polyfill like dialog-polyfill on legacy intranets.
Note: HTML dialog support varies across Chrome 37, Firefox 98, Safari 15.4, and the new closedby attribute. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!
The <dialog> element wraps a small set of methods, attributes, events, and CSS hooks that handle modality, dismissal, and styling without any custom JavaScript. The headline features focus on top-layer placement, native dismissal, and form integration.
HTML dialog support is broad now, but a handful of cross-browser quirks still bite teams that ship modals on legacy stacks or rely on the newest attributes. Most fixes are small once you know which browser is missing the feature.
In my experience, the loudest dialog bug on real-device runs is iOS Safari 15.4 letting the page scroll behind a showModal() modal on iPhone, because the backdrop fires touchmove through to body. The fix is to call event.preventDefault() on the dialog's touchmove listener until you can drop iOS 16.3 and earlier.
You open and close an HTML dialog by calling its showModal(), show(), or close() methods from JavaScript, or by submitting a form with method="dialog". The steps below open a modal, capture a return value, and close it on confirm.
Paste this snippet into the DevTools console of any modern browser to mount a confirm dialog and read the return value.
// Mounts a confirm dialog, opens it modally, and logs the user's choice.
const dialog = document.createElement("dialog");
dialog.innerHTML = `
<p>Delete this item permanently?</p>
<form method="dialog">
<button value="cancel">Cancel</button>
<button value="delete">Delete</button>
</form>
`;
document.body.appendChild(dialog);
dialog.addEventListener("close", () => {
console.log("returnValue:", dialog.returnValue);
});
if (typeof dialog.showModal === "function") {
dialog.showModal();
} else {
console.log("HTML <dialog> showModal() is not supported in this browser.");
}The <dialog> element and the popover attribute both place content in the browser top layer, but they target different UX patterns. <dialog> is the right choice for modal confirmations and forms, while popover covers tooltips, menus, and lightweight overlays.
| Dimension | HTML <dialog> | popover attribute |
|---|---|---|
| Element type | Standalone interactive HTML element | Global attribute on any element |
| Spec body | WHATWG HTML Living Standard | WHATWG HTML Living Standard |
| Modal mode | showModal() locks the page and paints a ::backdrop | Always non-modal; the page stays interactive |
| Default dismissal | closedby attribute, Escape key, or close() method | popover="auto" closes on Escape and outside click |
| Form integration | form method="dialog" closes the dialog and stores returnValue | No native form integration |
| Browser support | Chrome 37+, Firefox 98+, Safari 15.4+ | Chrome 114+, Firefox 125+, Safari 17+ |
| Best for | Confirmations, alerts, blocking forms, wizards | Tooltips, menus, hint cards, anchored UI |
All HTML dialog version numbers and platform notes in this guide come from these primary sources:
Did you find this page helpful?
More Related Hubs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance