Horje
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

Browser Support


How to Disable a section with the inert attribute

The button, the link, and the input field above are disabled because of the inert attribute.
index.html
Example: HTML
 <div inert>
  <button onclick="alert(42)">
  <input type="text">
  <a href="https://horje.com">Horje.com</a>
</div> 

Output should be:

How to Disable a section with the inert attribute




html inert attribute

Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference