簡體   English   中英

如何限制屏幕閱讀器不閱讀某些文本?

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

想象一下,我有一個帶有aria-label<div>作為“ Read this”(在運行時添加了aria-label )。 <div>內部,我有一個<span> ,其文本為“請勿閱讀此內容”。

現在Jaws所做的是,它同時讀取了文本(“讀此”和“不讀此”)。

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

期望僅閱讀“閱讀本文”。 是否有限制屏幕閱讀器強制停止閱讀文本的方法?

aria-hidden="true"是您想要的東西

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

請注意,並非所有的屏幕閱讀器都會讀取div元素上的aria-label ,並且它會導致空白元素

適用於JAWS 2018,Chrome 72:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM