Can I do <div aria-hidden> instead of <div aria-hidden="true"> or should I always do <div aria-hidden="true">?
The current version of spec indicates that "aria-hidden" is a state, and it could have three values:
false: The element is exposed to the accessibility API as if it was rendered.
true: The element is hidden from the accessibility API.
undefined (default): The element's hidden state is determined by the user agent based on whether it is rendered.
This means that when aria-hidden attribute is set on an element without an explicit true or false value, it will be considered hidden if it is not rendered.
Can I do
<div aria-hidden>instead of<div aria-hidden="true">or should I always do<div aria-hidden="true">?
<div aria-hidden> and <div aria-hidden="true"> are not equivalent, and you must set aria-hidden="true" if the element is visible on screen but you wish to hide it from the accessibility API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With