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

ARIA: aria-grabbed attribute

· 52CE 我爱测

The `aria-grabbed` state indicates an element's "grabbed" state in a drag-and-drop operation.

The aria-grabbed state indicates an element's "grabbed" state in a drag-and-drop operation.

Description

Text selections, images, and links can be dragged by default. Setting the global draggable="true" attribute, part of HTML5's Drag and Drop API, with a dragstart event handler, means any DOM node can be made draggable as well.

The aria-grabbed attribute was used to indicate if an element is in a "grabbed" state in a drag-and-drop operation with aria-grabbed="true" or if that the element is grabbable, but not currently grabbed with aria-grabbed="false".

Setting aria-grabbed="true" indicated the element had been selected for dragging. Setting aria-grabbed="false" indicated that the element could be grabbed for a drag-and-drop operation, but is not currently grabbed.

When aria-grabbed is set to true, the aria-dropeffect attribute of all potential drop targets should be updated with the type of function, or effect, will occur to the grabbed element when it is dropped. When no element is in a grabbed state, revert the aria-dropeffect attributes of all your drop targets.

The aria-grabbed property is expected to be replaced by a new feature in a future version of WAI-ARIA and is considered deprecated.

[!NOTE] ARIA does not enable accessible functionality. ARIA only conveys the intended behavior of your functionality.

Values

  • true
    • : The element has been selected for dragging.
  • false
    • : The element is not currently selected for dragging, but can be made available for dragging by setting the property to true.
  • undefined (default)
    • : The element does not support being dragged

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

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

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