html - 角色 ="tooltip"重要吗?

标签 html accessibility screen-readers uiaccessibility

  1. 大多数屏幕阅读器默认阅读自定义工具提示信息。 role="tooltip"似乎没有做任何额外的事情,就像它没有通知用户它的工具提示。为什么我们需要为工具提示容器使用 role="tooltip"?有什么具体目的吗?
  2. NVDA 无法在 IE11 中读取工具提示信息。有什么破解方法可以解决吗?

这是我的代码:

<div class="ttipcontainer">
  <button title="" class="co_tooltipElement" id="newButton05-2" aria-describedby="coid_accessibleTooltip_1"> Recent Searches </button> 
  <span tabindex="-1" class="co_accessibilityLabel" id="coid_accessibleTooltip_1" aria-hidden="true" role="tooltip">Shows information of your recent searches</span>
</div>

最佳答案

Heydon Pickering 有一个很好的写作指南 Accessible Toggle Tips .他在其中描述了为什么我们将 role=tooltip 放在元素上:

Note the use of the tooltip role. In practical terms, all this role offers is an assurance that aria-describedby works reliably where supported. As Léonie Watson writes, ARIA labels and descriptions sometimes don't work with all elements unless you incorporate an appropriate role. In this case, the most important role is the implicit button role of the subject element, but role="tooltip" may extend support for this labeling method in some software.

因此,虽然它没有提供太多额外信息,但它确实帮助 aria-describedby 指向具有有效角色的元素,这有助于确保它对某些屏幕阅读器正常工作。

关于html - 角色 ="tooltip"重要吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51195671/

相关文章:

javascript - HTML5 Canvas 的 Uncapped 与 SetInterval 帧速率?

javascript - 列出 DOM 对象上的变量和方法

javascript - 用鼠标旋转轮盘

javascript - 可以动态设置图像替代文本吗?

ios - 如何获得符合辅助功能设置的等宽字体

html - 如何隐藏屏幕阅读器的链接?

jquery - 在 div 之间滚动 - jQuery

java - 如何支持 JavaFX 2.2 中的辅助技术?

html - 将屏幕阅读器文本(和元信息文本)设置为与可见文本不同的值

ajax - 是否可以在 JAWS 9 或 10 中强制刷新缓冲区?