Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARIA attributes for reading alternative text (e.g. Roman Numerals) in HTML

In my HTML document I am using roman numbers (e.g.: MMXV = 2015).

Is there a way to inform screen readers to interpret certain text in another way (e.g.: roman numerals as "Two thousand and fifteen" instead of M-M-X-V)?

My guess was that there would be an ARIA attribute, but I cannot seem to find one. E.g.:

<time datetime="2015" aria-?="Two thousand and fifteen">MMXV</time>
like image 253
bashaus Avatar asked Feb 28 '15 17:02

bashaus


1 Answers

Use the aria-label tag to give the element a meaningful description.

Then, hide the roman numerals from screen readers by wrapping them in a span element that has the aria-hidden property set to true to hide the element from screen readers.

<time datetime="2015" aria-label="Two thousand and fifteen">
    <span aria-hidden="true">MMXV</span>
</time>
like image 174
unobf Avatar answered Nov 15 '22 21:11

unobf