Modern HTML Replaces JavaScript for Popovers, Dialogs and Accordions — With Caveats
Chris Burnell’s page, built for HTML Day 2026, catalogs browser-native features that now handle work once reserved for JavaScript. The popover and popovertarget attributes deliver light-dismiss overlays with automatic z-index and Esc handling; the <dialog> element covers modal boxes; and a shared name attribute turns a set of <details> elements into an exclusive accordion with no script at all. Newer invoker commands (command/commandfor) let plain buttons open and close these elements, loading="lazy" defers offscreen images without an IntersectionObserver, and hidden="until-found" reveals content when a user searches or jumps to a fragment. Native color, range, date, and <datalist> autocomplete inputs round out the list.
The more interesting angle is Burnell’s honesty about the gap between spec and reality. He revised the page after publishing specifically to flag where implementations fall short, warning that form controls ship with wildly inconsistent default styling and poor accessibility, that hidden="until-found" cooperates with browser search but not screen-reader search, and that <datalist> support is spotty enough to skip for now. Invoker commands are only partially landed — copy, media control, and increment actions are still future work.
The practical takeaway for engineers is that the web platform has quietly absorbed a lot of common UI plumbing, cutting dependency weight and script complexity, but the maturity is uneven. Several of these features are production-ready, while others are worth tracking rather than adopting — and none absolve developers of testing accessibility rather than assuming the browser handles it.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.