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

ARIA: generic role

· 52CE 我爱测

The `generic` role creates a nameless container element which has no semantic meaning on its own.

The generic role creates a nameless container element which has no semantic meaning on its own.

[!NOTE] The generic role is the implicit role of generic elements used by user agents. It is included here for completeness of documentation. It should not be used by web authors.

Description

While ARIA is primarily used to express semantics, there are some elements that shouldn't expose a semantic name to assistive technologies. The generic role indicates an element's role is equivalent to that of the non-semantic div and span elements.

The generic role is intended for use as the implicit role of generic elements in host languages for use by user agents only; not for use by developers. Instead, to remove implicit accessibility semantics, use presentation or none, the div and span elements that have no semantic meaning, or semantic container roles such as group to semantically group descendants in a named container.

Like an element with role presentation, an element with role="generic" can provide a limited number of accessible states and properties for its descendants, such as aria-live attributes. However, unlike elements with role presentation, generic elements are exposed in accessibility APIs so that assistive technologies can gather certain properties such as layout and bounds.

Because the generic role is nameless, the aria-labelledby and aria-label attributes are prohibited. Because the role is generic, the aria-roledescription and aria-brailleroledescription attributes are also prohibited.

[!NOTE] The element with role="generic" should not have an accessible name or role description.

Associated WAI-ARIA roles, states, and properties

None. If a global ARIA state and property is set, generic or none will be ignored, and the implicit role of the element will be used.

Examples

This role is for use by user agents and not by developers. As such, no appropriate example exists.

Specifications

See also

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

资料来源与适用范围

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

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

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