HTML global attributeGlobal attributes

inert

Disables interaction with an element and its descendants: clicking, focus and screen readers.

Applies to
All HTML elements
On this page

Example

#
HTML
<style>
  [inert] { opacity: 0.45; }
</style>

<section>
  <p>Step 1: enter your name</p>
  <input placeholder="Your name">
</section>
<section inert>
  <p>Step 2: choose a course (finish step 1 first)</p>
  <button type="button">HTML and CSS</button>
  <button type="button">Python</button>
</section>
Preview

Definition and usage

#

The boolean inert attribute makes a part of the page “dead”: nothing in it can be clicked, focused with the Tab key or searched, and screen readers skip it. The element is still visible, though.

It is useful when part of the interface is temporarily unavailable: the content under an open side panel, a form while it is being submitted, or wizard steps the user has not reached yet.

The browser does not change the appearance of such a part, so it is worth adding your own style, for example reduced opacity, so the user knows it cannot be used.

Syntax

#
Syntax
<element inert>…</element>

Browser support

#

Widely available · since 2023

Works in all modern browsers, phones included. You can use it without worry.

  • Chrome
  • Edge
  • Firefox
  • Safari

Good practices

#
  • A modal <dialog> opened with showModal() makes the rest of the page inactive on its own, so you do not need to add inert by hand.
  • Do not mark content the user has to read as inert. Screen readers will not read it.

Related entries

#

Spotted a mistake or missing an example? Write to us.