What “HTML Can Do That” Means and How to Use It

A recurring theme in web development discussion is that modern HTML handles interactions — dialogs, popovers, accordions, lazy loading — that developers.

A recurring theme in web development discussion is that modern HTML handles interactions — dialogs, popovers, accordions, lazy loading — that developers still build with JavaScript. This guide explains which native elements exist and how to check support.

Key takeaways

  • Modern HTML includes elements and attributes that replicate widgets many teams still assemble from JavaScript libraries, including dialogs, disclosure widgets and native form validation.
  • Using a native element generally brings keyboard behaviour, focus handling and screen-reader semantics without extra code, though the exact behaviour varies between browsers.
  • Browser support for newer HTML features is uneven, so any decision to drop a JavaScript dependency should be checked against current compatibility data rather than assumed.
  • Native elements are deliberately limited in how far they can be restyled, which is one reason developers continue to reach for custom implementations.
  • The practical approach is incremental: replace one component at a time, test with a keyboard and a screen reader, and keep a fallback where support is thin.

What is actually being claimed

The phrase “HTML can do that” is shorthand for a specific observation: a component a team has written in JavaScript may already exist as a built-in browser feature. The usual examples are structural rather than exotic. A collapsible section can be written with <details> and <summary> rather than a click handler that toggles a class. A modal can use the <dialog> element and its showModal() method rather than a hand-rolled overlay with manual focus trapping. A tooltip or menu can use the popover attribute, which asks the browser to handle layering and light dismissal. Images and iframes can defer loading with a loading attribute rather than an intersection observer.

Related capabilities sit in forms and inputs. Constraint validation attributes such as required, pattern, min, max and the various type values produce validation messages and blocking behaviour without a validation library. The <datalist> element offers a suggestion list attached to a text input. Attributes such as inputmode and autocomplete change the keyboard and autofill behaviour on mobile devices. None of these are new inventions announced this week; they are existing parts of the platform that many developers have not adopted.

Why the subject keeps resurfacing

The topic circulates periodically on developer aggregators because the gap between what the platform offers and what teams actually ship is persistent. Several forces sustain it. Front-end practice for years defaulted to component libraries, so a generation of developers learned to build a modal as a framework component before ever encountering the native element. Browsers have continued shipping HTML and CSS features in the intervening period, meaning the platform baseline moved while established habits did not. Discussion threads on the subject tend to mix genuine discovery with pushback from developers who tried a native element, hit a styling or behaviour limitation, and reverted.

The precise reason any individual post trends is not something that can be established from a headline and a vote count alone. What can be said is that the underlying tension — platform capability against custom implementation — is a long-running one rather than a response to a single event.

Background for someone new to this

HTML is the markup layer that describes a page’s structure and meaning. Historically it was largely static: it declared headings, paragraphs, links and form fields, and anything interactive was added with JavaScript. Over time the specification has absorbed patterns that were common enough to standardise. When a browser implements one of these, the interaction, keyboard handling and accessibility semantics arrive together, because the browser already knows what the element is for.

This matters for accessibility in particular. A custom modal built from generic <div> elements conveys nothing to assistive technology unless the developer adds the correct ARIA roles, manages focus on open and close, handles the Escape key and prevents interaction with content behind it. A native dialog is designed to provide much of that, though implementations differ and testing remains necessary. The general principle in accessibility guidance is to prefer a native element over a custom one built to imitate it, precisely because the native version carries semantics by default.

The counterweight is styling. Browser-supplied widgets historically exposed limited styling hooks, which is why select menus, date pickers and file inputs look different across browsers and resist design systems. Work has been ongoing to give developers more control over some of these, but the degree of control varies by element and by browser, and this remains the main practical objection to native-first approaches.

Who this affects and how

Front-end developers are the immediate audience, and the effect is mostly on maintenance load. Every custom widget is code that must be tested, kept accessible and carried across framework upgrades. Replacing one with a native element removes that burden, at the cost of accepting the browser’s behaviour and appearance.

Designers are affected because native elements constrain visual specification. A design that assumes complete control over a dropdown’s appearance may not be achievable with a native select in every browser, which forces an early conversation rather than a late compromise.

Accessibility specialists tend to favour native elements where they fit, since a correct default is more reliable than a custom implementation maintained by a team without specialist knowledge. Users are affected indirectly: less JavaScript typically means faster loading and fewer failure modes when scripts do not execute, though the size of that benefit depends entirely on the site.

Where informed people disagree

There is genuine disagreement rather than simple ignorance on one side. One camp argues that native elements should be the default and that most custom widgets are unnecessary reinvention that produces worse accessibility. The other argues that native elements are frequently too rigid for production design requirements, that behaviour differences between browsers create their own testing burden, and that a well-maintained library gives more predictable results across the range of browsers a product supports.

A second disagreement concerns timing. Features reach browsers at different times, and older versions remain in use for years in some contexts. Deciding when a feature is safe to rely on without a fallback is a judgement about a particular audience, not a universal answer. Teams supporting enterprise or public-sector users with older software will reach a different conclusion from teams shipping to a modern consumer audience.

A third concerns behaviour under the surface. Native elements sometimes behave in ways that differ subtly from a custom equivalent — how they interact with scrolling, stacking contexts, or existing framework state management. These differences are minor in isolation but can be disruptive inside a large application.

Practical implications and how to proceed

A workable approach is incremental rather than wholesale. Start by listing the interactive components in a project and marking the ones with a plausible native counterpart: modals, accordions, tooltips, autocomplete fields, form validation, lazy-loaded media.

For each candidate, check current browser compatibility data before changing anything. Compatibility references maintained by browser vendors and standards-adjacent organisations are the appropriate source; assumptions based on when a feature was announced are not. Where support is incomplete, decide whether a degraded experience is acceptable or whether a fallback is required.

Then build one replacement and test it properly: keyboard navigation with the Tab and Escape keys, a screen reader, mobile browsers, and any browser your audience uses in significant numbers. Confirm the styling requirement can be met before committing the change more widely. Keep the JavaScript version available until the native version has been through a full release cycle.

Progressive enhancement remains the safest structure. Markup that works without JavaScript, enhanced where the browser supports more, avoids the situation where a feature gap becomes a broken page.

What to watch next

Three threads are worth following. The first is continued standardisation of styling control for browser-supplied widgets, which would remove the main objection to native-first approaches if it matures. The second is the adoption curve: whether framework and component-library authors begin building on native primitives rather than around them, which would change defaults for a large number of developers at once. The third is compatibility data itself — the point at which a feature becomes safe to use without a fallback shifts continuously, so a decision made a year ago is worth revisiting.

None of this resolves into a single rule. The reasonable position is to know what the platform provides, verify support before depending on it, and choose deliberately rather than by habit.

Frequently asked questions

Is native HTML always better than a JavaScript component?

No. Native elements usually bring better default accessibility and less code to maintain, but they can be harder to style and their behaviour varies between browsers. A well-maintained library may give more predictable results across a wide browser range. The right choice depends on your design requirements, your audience’s browsers, and how much custom behaviour the component needs. Evaluate component by component rather than adopting a blanket rule.

Which HTML features replace common JavaScript widgets?

Commonly cited examples include <details> and <summary> for collapsible sections, the <dialog> element for modals, the popover attribute for layered transient content, <datalist> for input suggestions, and the loading attribute for deferring images and iframes. Form constraint validation attributes cover a range of validation cases. Support and exact behaviour differ between browsers, so check current compatibility data for each feature before relying on it.

How do I check whether a feature is safe to use?

Consult a browser compatibility database rather than relying on announcements or blog posts. Vendor documentation and standards-adjacent compatibility references list support by browser and version, which lets you compare against your own analytics. If a meaningful share of your users are on versions without support, either provide a fallback or defer adoption. Feature detection in code is also possible for many capabilities.

Do native elements guarantee accessibility?

They give a better starting point but not a guarantee. Native elements carry semantics and keyboard behaviour that a generic <div> does not, which removes a common source of accessibility failure. Implementations still vary between browsers and assistive technologies, and surrounding markup can undermine a correct element. Testing with a keyboard and at least one screen reader remains necessary regardless of which approach you choose.

Why do developers still build custom versions?

The main reasons are styling control, cross-browser consistency and integration with existing application state. Browser-supplied widgets have historically exposed limited styling hooks, so designs requiring full visual control were difficult to achieve natively. Teams also standardise on a component library for consistency, and replacing part of it creates a mixed system. These are practical constraints rather than simple unawareness of the alternatives.

Will replacing JavaScript with HTML make my site faster?

Possibly, but the effect depends on the site. Removing a dependency reduces the amount of script downloaded, parsed and executed, which can improve loading and responsiveness. If the dependency is small relative to the rest of the page, the difference may be negligible. The more reliable benefits are usually reduced maintenance and fewer failure modes when scripts do not load or execute correctly.

Sources and further reading

  • Browser vendor developer documentation, which describes HTML elements and attributes and includes per-browser compatibility tables.
  • The HTML specification maintained by the relevant standards body, which defines element behaviour authoritatively.
  • Web accessibility guidance from standards organisations, covering the preference for native semantics over custom implementations.
  • Developer community aggregators and discussion threads, useful for practitioner experience but not authoritative on support or behaviour.

Surfaced from the hackernews signal “native HTML capabilities discussion”. AI-assisted draft, editorially reviewed.

Visited 1 times, 1 visit(s) today
share this recipe:
Facebook
X
WhatsApp
Telegram
Email
Reddit