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

ARIA: term role

· 52CE 我爱测

The `term` role can be used for a word or phrase with an optional corresponding `definition`.

The term role can be used for a word or phrase with an optional corresponding definition.

Description

The term role can be used for a word or phrase with an optional corresponding definition. It is equivalent in semantics to the HTML dfn element and the definition term (dt) element within a definition list (dl ).

The term role is used to explicitly identify a word or phrase for which a definition has been provided by the author or is expected to be provided by the user. If there is an existing definition, or a form or form control to enter a definition, authors SHOULD set aria-details to point to the related element.

Don't use the role="term" on interactive elements like links because it can interfere with assistive technology users ability to interact with the element. Also, the term itself is the accessible name, so do not use aria-label or aria-labelledby.

[!WARNING] The accessible name should be the term itself, so DO NOT use aria-label or aria-labelledby.

Associated WAI-ARIA roles, states, and properties

None.

Keyboard interactions

None.

Required JavaScript features

None.

Examples

<p>
  <span role="term">Mansplaining</span>,
  <span role="definition"
    >a portmanteau of "man" and "explain", is the patronizing act of explaining
    without being asked to do so, to someone already learned on the topic, often
    after someone has already explained it</span
  >.
</p>

Including better semantics, the above could also be written:

<p>
  <dfn role="term">Mansplaining</dfn>,
  <span role="definition"
    >a portmanteau of "man" and "explain", is the patronizing act of explaining
    without being asked to do so, to someone already learned on the topic, often
    after someone has already explained it</span
  >.
</p>

or without any ARIA (but possibly not how you want it presented)

<dl>
  <dt>Mansplaining</dt>
  <dd>
    A portmanteau of "man" and "explain", is the patronizing act of explaining
    without being asked to do so, to someone already learned on the topic, often
    after someone has already explained it.
  </dd>
</dl>

Accessibility concerns

Don't use the role="term" on interactive elements such as links as it can interfere with the assistive technology user's ability to interact with the element.

Best practices

Allow the term itself to define the accessible name. Do not use aria-label or aria-labelledby.

Specifications

See also

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

资料来源与适用范围

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

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

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