Opening and Closing Dialogs Without JavaScript Using HTML Invoker Commands
January 12, 2026

The native
<dialog>element was a huge step forward for web developers. It gave us a standardized way to create modal dialogs with built-in backdrop handling, focus management, and keyboard interactions—no more reinventing the wheel withdivcontainers and mountains of JavaScript.But we still needed JavaScript for one fundamental task: opening the dialog.
The HTML Invoker Commands API changes that. Now you can create fully functional dialogs with just HTML.
Having started as a declarative platform with HTML and then CSS, the web has become increasingly imperative with JavaScript and DOM APIs over the last 20 years or so. But in recent years the declarative approach has made a comeback even where traditionally we may have needed JavaScript. And one area in which this is particularly true is within focus, which we’ve covered quite a bit here and in our conferences. There’s a new frontier for declarative web–now we can open dialog without any JavaScript.







