What HTML Can Still Do in 2026 (That Most Sites Ignore)

Native HTML now handles dialogs, popovers, tooltips, lazy images, form validation, and accordions without JavaScript. In 2026 I use dialog, popover, and commandfor in production, though support for the newest attributes is still uneven, so I check before dropping a polyfill.
Part of the complete web development guide.
On this page
- The dialog element finally stopped being a trap
- Popover and anchor positioning are the big 2026 story
- Where I still write JavaScript
- Native lazy loading and responsive images, done right
- Form validation without a validation library
- What to actually do with this
- FAQ
- Is it safe to drop my modal and tooltip libraries in 2026?
- Do native HTML features actually help SEO?
- How much JavaScript should a typical small business site ship?
Most sites I audit are shipping 200KB of JavaScript to do things the browser has handled natively for years. Dialogs, popovers, tooltips, lazy images, form validation, accordions. All of it is HTML now. The catch is that a few of these features landed recently, and the browser support picture in 2026 is uneven in ways that will bite you if you do not check.
So here is an honest rundown. What works, what I actually use in production, and where I still reach for a polyfill or a small script.
The dialog element finally stopped being a trap
For years <dialog> was technically supported everywhere but behaved differently enough that nobody trusted it. That era is over. In 2026 you get a real modal with focus trapping, escape-to-close, and a backdrop, all from markup.
<dialog id="signup">
<form method="dialog">
<h2>Get the newsletter</h2>
<label>
Email
<input type="email" name="email" required>
</label>
<button value="cancel">No thanks</button>
<button value="confirm">Sign up</button>
</form>
</dialog>
<button commandfor="signup" command="show-modal">
Subscribe
</button>
Two things worth noting. First, method="dialog" closes the dialog on submit and sets its returnValue, so you do not need to wire up a close handler by hand. Second, the commandfor and command attributes are the newer, cleaner replacement for showModal() calls. They are widely supported now, but if you need to support browsers from a couple of years back, keep a two-line JS fallback that calls showModal() directly. That is a lot less code than the modal libraries people were loading in 2020.
One real gotcha: <dialog> does not animate its backdrop out of the box. If you want a fade, you need @starting-style and transition-behavior: allow-discrete. It works, but it is fiddly, and I have seen it break in older Safari.
Popover and anchor positioning are the big 2026 story
The popover attribute gives you a top-layer element with light-dismiss and escape handling for free. Combine it with CSS anchor positioning and you can build a tooltip or dropdown menu that follows its trigger without a positioning library.
<button id="help" popovertarget="tip">What is this?</button>
<div id="tip" popover>
We only use this to remember your theme.
</div>
<style>
#tip {
position-anchor: --help;
top: anchor(bottom);
left: anchor(center);
margin-top: 8px;
}
#help { anchor-name: --help; }
</style>
This is the part where I tell you to test carefully. Anchor positioning shipped across the major engines, but the details around fallbacks (what happens when the tooltip would run off screen) are still evolving. For a simple tooltip on a marketing page, go for it. For a complex date picker that needs to flip and stay in viewport, I still measure whether a small library is worth the bytes.
Where I still write JavaScript
- Anything that needs to persist server state. HTML does not talk to your API.
- Complex focus management across multiple nested layers. The primitives help, but the orchestration is still yours.
- Analytics events on interaction. You will be adding listeners regardless.
The point is not “never use JS.” It is that the default should be markup, and JS should be for the parts markup genuinely cannot do. I have cut 40 to 60 percent of script weight off small business sites just by swapping custom components for native ones. That shows up in Core Web Vitals and in how fast the page feels on a phone over cellular.
Native lazy loading and responsive images, done right
loading="lazy" is old news, but people still misuse it. Do not lazy-load your hero image. It is above the fold and lazy loading it delays your LCP. Use fetchpriority="high" on it instead and let everything below the fold be lazy.
<img
src="hero-1200.avif"
srcset="hero-800.avif 800w,
hero-1200.avif 1200w,
hero-1800.avif 1800w"
sizes="(min-width: 900px) 60vw, 100vw"
width="1200" height="800"
fetchpriority="high"
alt="Storefront on Main Street">
Always set width and height. That is what prevents layout shift, and CLS is still a ranking factor. AVIF is the right default in 2026, with WebP as a fallback if you care about the last few percent of older devices.
Form validation without a validation library
Constraint validation covers more than most developers think. You can express a lot of rules in the markup and get accessible error messaging for free.
<input
type="text"
name="zip"
inputmode="numeric"
pattern="[0-9]{5}"
required
aria-describedby="zip-hint">
<p id="zip-hint">Five digit ZIP code</p>
What native validation will not do: validate against your server, show custom styling on the browser’s own bubble, or do async checks like “is this username taken.” For those you write JS. But you should let the browser handle the easy 80 percent first, because it is faster and it works even when your script fails to load.
What to actually do with this
Sit down with your current site and look for components that reimplement something native. Modals, tooltips, dropdowns, accordions, image galleries, form validation. Pick one, replace it with the HTML version, and measure the difference. If you want help deciding what is worth the refactor, that is the kind of work I do as a custom web development consultant, and it is usually a smaller job than people expect.
I have been doing this from Commack for a long time, and the pattern has not changed: the platform keeps absorbing jobs that used to need libraries. The developers who keep up ship lighter, faster sites for the same money. The ones who do not keep paying the tax in bundle size.
FAQ
Is it safe to drop my modal and tooltip libraries in 2026?
For simple cases, yes. <dialog> and popover are supported across current browsers. If you need complex positioning, nested layers, or support for browsers more than about two years old, test first and keep a small fallback.
Do native HTML features actually help SEO?
Indirectly, and it matters. Less JavaScript means faster loads and better Core Web Vitals, which Google uses as a ranking signal. Cleaner markup also makes it easier for crawlers to parse your content. There is no direct “HTML bonus,” but the performance effect is real.
How much JavaScript should a typical small business site ship?
Less than most do. A content site can often run on a few kilobytes of JS if you lean on native elements. If your bundle is over 200KB gzipped for a site that mostly shows text and images, something is wrong, and it is usually a component library doing work the browser already does.


