JavaScript has long powered interactive web features like accordions, dropdowns, modals, and offscreen navigation. But modern HTML offers native alternatives that eliminate JS entirely, reducing download sizes, improving performance, and freeing JS for more critical tasks.
Aaron T. Grogg’s HTMHell article showcases practical replacements:
Accordions use the details and summary elements. Add open attribute for default expansion, or name attribute for radio-button-style single-open panels. Perfect for hiding/showing content without scripts.
Autofilter inputs pair input with datalist for type-as-you-go suggestions. Works for text, numbers, times—ideal for search, filters, or forms (with noted browser/mobile limits).
Modals and popovers leverage the new popover attribute on dialog elements. Choose auto (light-dismissible), hint, or manual modes via popovertarget buttons. No JS needed for toggling overlays or side panels.
Offscreen nav uses popover with CSS translate: position it off-screen, then :popover-open brings it in. Add ::backdrop for overlays.
These native solutions boost accessibility and speed. Check browser compatibility on MDN links provided. For more, see the author’s expanded guide.
https://www.htmhell.dev/adventcalendar/2025/27/