Aria-owns demos
This page demonstrates support for aria-owns in Google Chrome and Mozilla Firefox.
The aria-owns property has been part of the ARIA spec for a long time, but historically, implementation has relied on AT support, which can be difficult and expensive to get right. Google Chrome and Mozilla Firefox both implement aria-owns by automatically rearranging the accessibility tree now.
Moving nodes in the accessibility tree
The most basic use of aria-owns is to move a node in the accessibility tree. In this example, there are three profile images in a row, and immediately below each image is a button to open the profile. In the DOM, the three images come first and the three buttons come next, so the semantic order in the accessibility tree is wrong. With aria-owns we can move the buttons in the accessibility tree without affecting the DOM tree.
Check out the code, then explore the before and after examples using a screen reader or accessibility inspection tool.
Without aria-owns



With aria-owns



Reordering children
Another use of aria-owns is to keep the existing children of an HTML element, but simply reorder them so that it makes more sense for accessibility. In this example, the DOM order is backwards, but using aria-owns, the accessibility tree will have the list items in the correct order.
- Third
- Second
- First
Without aria-owns
- Third
- Second
- First
With aria-owns
- Third
- Second
- First
Building a list
Another use of aria-owns is to construct an ARIA list when there isn't a suitable container element as the parent of the list items.
Item OneItem Two
Without aria-owns
With aria-owns
Building a grid
Similarly aria-owns can be used to construct an ARIA grid.
Cell 1, 1Cell 1, 2Cell 1, 3Cell 2, 1Cell 2, 2Cell 2, 3
Without aria-owns
With aria-owns
Dynamic changes
Aria-owns should work correctly if aria-owns is dynamically added to an element.
Aria-owns should also work correctly if aria-owns references an element it that's not on the page, and it later gets added.
References
aria-owns in the ARIA spec.