The inertglobal boolean attribute marks an element as inert: the element and its descendants cannot be focused, clicked, or edited, and are typically skipped by assistive technologies — even when they remain visible on screen.
Use it to fence off background UI while a dialog or overlay is open. Prefer native <dialog>showModal() when a true modal is enough; add inert for custom overlays or extra control.
Baseline · Widely available.
Supported in modern Chrome, Firefox, Safari, and Edge.
Visibility is separate.
Inert content can still take space. Dim or hide it with CSS if you also need a visual backdrop treatment.
Syntax
HTML Syntax
syntax.html
<element inert>
Boolean attribute — presence means true. Remove it (or set element.inert = false) to restore interaction.
Put the toggle outside the inert subtree or it becomes unreachable.
Assign the property.true adds inert; false removes it.
Do not use inert="false". Presence still means inert for boolean attributes.
Remember to unlock when the blocking UI closes.
Edge Cases & Pitfalls
Most bugs come from leaving inert on or nesting focus incorrectly.
focus
Focused elements lose focus
If focus is inside when you set inert, the browser moves it. Restore focus when unlocking.
nested
Cannot un-inert a child
A descendant stays inert while any ancestor is inert.
dialog
Native dialog modality
showModal() already makes the rest of the page inert-like. Extra inert is optional for custom overlays.
boolean
inert="false" still inert
Remove the attribute or set element.inert = false.
Compatibility
Browser Support
inert is an HTML attribute for browsers. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
inert
Supported in modern Chrome, Firefox, Safari, and Edge.
96%Global support (approx.)
Google Chrome102+
Full support
Mozilla Firefox112+
Full support
Apple Safari15.5+
Full support
Microsoft Edge102+
Full support
Opera88+
Full support
Samsung Internet20+
Full support
Internet ExplorerNo support
Not supported
inertWidely supported
Bottom line: Safe for modern sites. Polyfill only if you must support very old browsers.
Remember
Key Takeaways
Role: freeze a whole subtree from interaction.
Not hidden: content can stay visible.
Not disabled: works beyond form controls.
Remember: remove inert when the overlay closes.
One line:inert freezes interaction for a subtree without necessarily hiding it.
Frequently Asked Questions
It makes the element and its descendants non-interactive: no click, focus, or edit, and assistive technologies typically ignore the subtree — even if it stays visible.
No. disabled is for form controls. inert applies to any element and freezes its whole subtree.
No. hidden removes content from presentation (often display:none). inert can leave content on screen while blocking interaction.
Commonly for the page behind a modal, custom overlays, off-canvas drawers, or temporary loading shells where interaction would be confusing.
No. pointer-events only blocks pointer hits. inert also blocks focus and assistive exposure.
Yes — widely available in modern browsers. Older browsers need a polyfill or progressive enhancement.