大网数据广告活动
Web 标准与前端开发

ARIA: aria-relevant attribute

· 52CE 我爱测

Used in ARIA live regions, the global `aria-relevant` attribute indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.

Used in ARIA live regions, the global aria-relevant attribute indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.

Description

ARIA live regions are areas of a web page that are updated when user's attention may be elsewhere. When an update is outside of the user's keyboard focus, assistive technologies such as screen readers use a live region area to report updates to the user.

Examples of live regions include news marquees, stock tickers, chat windows, and score boards. These update without user interaction. Some updates are important for the user to know about. They're relevant. Others are not. The aria-relevant is used to describe what types of changes have occurred to an aria-live region, and which are relevant and should be announced.

The value is a space-separated list of change types, including additions, removals, and text, with a shorthand all meaning all three.

When aria-relevant is not defined, the value is inherited from the nearest ancestor with a defined value. Inherited values are not additive; the value provided on a descendant element completely overrides any inherited value from an ancestor element. When a live region doesn't have an aria-relevant attribute set and has no ancestor with it set, it defaults to additions text, which means element nodes are added to the accessibility tree within the live region, AND text content or a text alternative is added to any descendant in the accessibility tree of the live region. This is because generally text modifications and node additions are relevant, but node removals are not.

While not a supported value, if the value of none makes the most sense, it should not be a live region.

The values of removals and all should be used sparingly. For example, when a goal happens in the World Cup, the new score (the addition) is important, the old value (the removal) is not. Assistive technologies only need to be informed of content removal when its removal represents an important change, such as when a player is taken out of the game.

Values

  • additions
    • : Element nodes are added to the accessibility tree within the live region.
  • all
    • : Shorthand for additions removals text.
  • removals
    • : Text content, a text alternative, or an element node within the live region is removed from the accessibility tree.
  • text
    • : Text content or a text alternative is added to any descendant in the accessibility tree of the live region.

Associated interfaces

  • Element.ariaRelevant
    • : The ariaRelevant property, part of the Element interface, reflects the value of the aria-relevant attribute.
  • ElementInternals.ariaRelevant
    • : The ariaRelevant property, part of the ElementInternals interface, reflects the value of the aria-relevant attribute.

Associated roles

Used in ALL roles.

Specifications

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。