HTML Guide
The aria-owns
attribute contains an ID reference that does not match any element in the same document.
According to the ARIA specification and the WHATWG HTML standard, the value of the aria-owns
attribute must be a space-separated list of IDs of elements that exist in the same DOM document. This attribute is meant to modify the accessibility tree by creating relationships not present in the DOM structure, but all referenced elements must be part of the same document. If an ID in the aria-owns
attribute does not match any element, is in another document (such as an iframe), or contains a typo, validation will fail.
Common reasons for this issue:
- Referencing a nonexistent ID.
- Referencing an ID from another document (e.g., across iframes).
- Typos in the ID value.
Correct usage:
<div id="container" aria-owns="owned-element">
<p>Container</p>
</div>
<div id="owned-element">
<p>Owned by container (in accessibility tree)</p>
</div>
Incorrect usage (missing or cross-document ID):
<div id="parent" aria-owns="child"></div>
<!-- Missing <div id="child"> or 'child' exists in a different frame/document -->
To fix the issue, ensure that all IDs referenced in aria-owns
correspond to elements present in the same document.
Complete valid example:
<!DOCTYPE html>
<html lang="en">
<head>
<title>aria-owns Example</title>
</head>
<body>
<div id="menu" aria-owns="item1 item2">
Main menu (accessibility tree owner)
</div>
<div id="item1">
Menu item 1
</div>
<div id="item2">
Menu item 2
</div>
</body>
</html>
Learn more: