--- title: "Native interactive elements" category: accessibility status: recommended url: https://webspecification.com/spec/accessibility/native-interactive-elements/ updated: "2026-07-08T00:00:00.000Z" sources: - title: "WHATWG HTML — The details element" url: "https://html.spec.whatwg.org/multipage/interactive-elements.html#the-details-element" publisher: "WHATWG" - title: "WHATWG HTML — The dialog element" url: "https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element" publisher: "WHATWG" - title: "MDN — " url: "https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dialog" publisher: "MDN" - title: "WAI-ARIA Authoring Practices" url: "https://www.w3.org/WAI/ARIA/apg/" publisher: "W3C WAI" source_repo: undefined licence: CC-BY-4.0 --- # Native interactive elements > Prefer native HTML interactive elements — ``` `showModal()` opens it modally — focus is trapped, ESC dismisses, `::backdrop` styles the dim layer. Use `show()` for non-modal. For transient, non-blocking overlays (menus, tooltips, toasts) use the [Popover API](/spec/foundations/popover-api/) instead. **Buttons and links.** A ` ``` ## Common mistakes - **`
` as a button.** No keyboard activation, no focus, no accessible name, no role. - **`` as a button.** Pollutes browser history, breaks middle-click and "open in new tab", and announces as a link in screen readers. - **Rebuilding `
` in JavaScript "to control the animation".** Modern CSS — `interpolate-size`, `transition-behavior: allow-discrete`, `::details-content` — animates the native element. - **Scripting a single-open accordion.** Give sibling `
` the same `name` and the browser handles mutual exclusion for you, with correct disclosure semantics on every panel. - **Using `` for transient, non-blocking UI.** Reserve `` for modal flows that require a decision. For menus, popovers, and toasts, use the [Popover API](/spec/foundations/popover-api/). - **Forgetting `type="button"` inside a ``.** A bare `