HTML inert Attribute
Definition and Usage
The inert
attribute disables an element and
all the elements inside.
The elements are still visible, but they have no function: buttons and links cannot be clicked, input fields are disabled etc., and they are ignored by screen readers.
Applies to
The
inert
attribute is a Global Attribute, and can be used on any HTML element.
Element | Attribute |
---|---|
All HTML elements | inert |
Example
Example
Disable a section with the inert attribute:
<div inert>
<button onclick="alert(42)">
<input type="text">
<a href="https://w3schools.com">W3Schools.com</a>
</div>
Try it Yourself »
Browser Support
Attribute | |||||
---|---|---|---|---|---|
inert | 102 | 102 | 112 | 15.5 | 88 |
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.