Search code examples
htmltext-to-speech

Excluding verse numbers and footnote letters from text-to-speech readers


Are there any HTML tag attributes or code snippets that can be used to "hide" parts of a web page's text from a text-to-speech reader – for example, Speech on the Mac?

Specifically, I'm looking for a way that a text-to-speech reader can be used ignoring numbers from the beginning of verses and letters that are used to mark footnotes in the text.


Solution

  • You want aria-hidden:

    <span aria-hidden="true">this is hidden from screen readers</span>
    

    Be careful though:

    Authors MAY, with caution, use aria-hidden to hide visibly rendered content from assistive technologies only if the act of hiding this content is intended to improve the experience for users of assistive technologies by removing redundant or extraneous content. Authors using aria-hidden to hide visible content from screen readers MUST ensure that identical or equivalent meaning and functionality is exposed to assistive technologies.