我有这部分代码:
<div role="heading" aria-level="5" >
<span role="text" aria-label="This is another title example">Title example</span>
</div>
问题是我希望 JAWS 读取 aria 标签的文本“这是另一个标题示例”,但在标题列表中,我只想看到跨度文本“标题示例”。
我使用 role="text"
,这在 Chrome 中工作正常,但在 IE 中无效。
是否有正确的结构来满足我的要求(在标题列表中,我只想看到文本“标题示例”,但是当我使用 JAWS 导航时,标题发音必须是 aria-label '这是另一个标题示例')在 Chrome 和 IE 中?
答案 0 :(得分:0)
在回答问题之前,我会解释你做了什么以及错误在哪里。
<div role="heading" aria-level="5" >
<span class="sr-only">This is another </span><span role="text">Title example</span>
</div>
<h5>
<span class="sr-only">This is another </span>Title example
</h5>