![](/img/trans.png)
[英]How to replace '-' in value of aria-labelledby with jQuery?
[英]aria-labelledby not being read by NVDA Chrome
當用戶使用屏幕閱讀器時,我希望從span元素中存儲的隱藏文本中讀出H2元素。 這不適用於NVDA和Chrome / FF瀏覽器。 當我將鼠標懸停在h2元素上時,它只會顯示“ This is header”而不是“ This is Test”
<div >
<span id="hdnlbl" class="visuallyhidden">This is Test</span>
<h2 aria-labelledby="hdnlbl">This is header</h2>
</div>
這是現場示例https://jsfiddle.net/pwzeus/8jb1mxdm/13/
編輯
要求是它必須能夠在鼠標懸停時工作。 我該如何工作?
根據我理解的類,您的span
是隱藏的-aria aria-labelledby
labelledby僅當元素(示例中的跨度)未隱藏時才會讀取
(當錯誤被隱藏時,我們將其用於錯誤;對於輸入,則不讀取錯誤;當顯示錯誤時,將為輸入讀取錯誤)
祝好運
雪莉
無障礙專家
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.