简体   繁体   English

如何限制屏幕阅读器不阅读某些文本?

[英]How to restrict screen reader to not read a certain text?

Imagine, I have a <div> with aria-label as "Read this" ( aria-label is added at runtime). 想象一下,我有一个带有aria-label<div>作为“ Read this”(在运行时添加了aria-label )。 Inside the <div> , I have a <span> with text "do not read this". <div>内部,我有一个<span> ,其文本为“请勿阅读此内容”。

Now what Jaws is doing is, it reads both the text ("Read this" and "do not read this"). 现在Jaws所做的是,它同时读取了文本(“读此”和“不读此”)。

<div aria-label="Read this">
  <span>Do not read this</span>
</div>

The expectation is to only read "Read this". 期望仅阅读“阅读本文”。 Is there anyway to restrict screen readers to force stop reading a text? 是否有限制屏幕阅读器强制停止阅读文本的方法?

aria-hidden="true" is the thing you want aria-hidden="true"是您想要的东西

<div aria-label="Read this">
<span aria-hidden="true">Do not read this</span>
</div>

Note that not all screenreaders will read the aria-label on a div element and that it will result in a blank element 请注意,并非所有的屏幕阅读器都会读取div元素上的aria-label ,并且它会导致空白元素

works for JAWS 2018, chrome 72: 适用于JAWS 2018,Chrome 72:

 <div role="text" aria-label="Read this"> Do not read this </div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在IE中使用屏幕阅读器阅读替代文本 - How to read alt text using a screen reader in IE 如何确定屏幕阅读器阅读文本的顺序? - How can I determine the order in which text is read by a screen reader? 是否可以阻止某些文本的屏幕阅读器? - Is it possible to block a screen reader for certain text? 工具提示屏幕阅读器将读取的文字,但文字在视觉上保持隐藏 - Tooltip screen reader will read text of but text to remain visually hidden 如何以屏幕阅读器仍会阅读文本并向用户指示已禁用的方式“禁用”单选按钮? - How to “disable” a radio button in a way that a screen reader would still read the text and indicate to a user that it is disabled? 如何隐藏文本并使屏幕阅读器可以访问它? - How to hide a text and make it accessible by screen reader? 如何让屏幕阅读器宣布额外的文字 - How to let screen reader to announce extra text Ionic2如何处理屏幕阅读器文本? - Ionic2 How to handle the screen reader text? 禁用所有可访问性 API(屏幕阅读器)读取的占位符文本 - Disable placeholder text to be read by all accessibility API(screen reader) 使屏幕阅读器阅读跨度文本的正确方法是什么 - What is the correct way to make screen reader read span text
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM