HTML aria-level ARIA Attribute
The aria-level attribute gives the hierarchical level of an element in a structure, such as the level of a heading or the depth of an item in a tree.
Description
The aria-level attribute defines the level of an element within a hierarchy, starting at 1. It is required on the heading role, where it plays the same part as the number in <h1> to <h6>, and it is used on tree items and treegrid rows to show how deeply they are nested.
On a tree, the browser can usually work out the level from the DOM structure when items are nested in groups. Set aria-level when the structure is flat in the DOM, or when only part of the tree is loaded, together with aria-posinset and aria-setsize.
For headings, the native elements are better: <h2> is simpler and more reliable than role="heading" aria-level="2". Don't use aria-level to change the level of a native heading element.
Properties
Syntax
<element role="heading" aria-level="number">
Values
- integerThe level, 1 or higher.
Example
Browser Support
The following information will show you the current browser support for the aria-level ARIA attribute. Hover over a browser icon to see the version that first introduced support for this ARIA attribute.
Desktop





Tablets & Mobile





