Element.ariaPosInSet is an instance property that reflects the aria-posinset attribute. Learn how it marks an item’s position in a set of listitems or treeitems, how to pair it with aria-setsize, and how to get or set the property from JavaScript—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String (integer)
03
Meaning
Position in set
04
Reflects
aria-posinset
05
Status
Baseline widely
06
Pair with
aria-setsize
Fundamentals
Introduction
Screen readers often announce list position—“item 2 of 5”—when you move through a native <ul> or <ol>. Custom listitems may not expose that order unless you declare it.
aria-posinset marks an item’s position in the current set. ariaPosInSet is the JavaScript reflection of that attribute.
JavaScript
const el = document.getElementById("article2");
console.log(el.ariaPosInSet); // "2"
el.ariaPosInSet = "3";
💡
Beginner tip (MDN)
Prefer native lists when the DOM already expresses order. Use aria-posinset and aria-setsize on custom listitems or treeitems when assistive technology needs an explicit position in the set.
Concept
Understanding the Property
MDN: the ariaPosInSet property of the Element interface reflects the value of the aria-posinset attribute, which defines the element’s number or position in the current set of listitems or treeitems.
Reflected attribute — mirrors aria-posinset.
Get / set — readable and writable string containing an integer.
Pair with — aria-setsize for total set size.
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaPosInSet
Value
A string containing an integer.
Example
Meaning
"1"
First item in the set
"2"
Second item in the set
"3"
Third item, and so on
⚠️
Pair with aria-setsize
Set ariaPosInSet and ariaSetSize on each listitem or treeitem so assistive technology can announce “item 2 of 5.”
Pattern
📋 MDN Example Shape
MDN starts with aria-posinset="2" on an article, then updates it to "3" with the property:
Element.ariaPosInSet is Baseline Widely available (MDN: across browsers since October 2023). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline Widely available
Element.ariaPosInSet
String integer — reflects aria-posinset for position in a set of listitems or treeitems.
BaselineWidely available
Google ChromeSupported (ARIA reflection)
Yes
Microsoft EdgeSupported (ARIA reflection)
Yes
Mozilla FirefoxSupported (ARIA reflection)
Yes
Apple SafariSupported (ARIA reflection)
Yes
OperaFollow Chromium support
Yes
Internet ExplorerNo ariaPosInSet IDL — use setAttribute
No
ariaPosInSetBaseline
Bottom line: Use ariaPosInSet to declare position in a set for listitems and treeitems. Pair with ariaSetSize. Prefer native HTML lists when you can. Keep the value as a string integer such as "1" or "2".
Wrap Up
Conclusion
ariaPosInSet reflects aria-posinset so list and tree widgets can expose their position in a set as a string integer. Reach for native lists first; use this property when custom listitems or treeitems need explicit set position.
Keep positions consistent when items are reordered
Test list navigation with a screen reader
❌ Don’t
Skip native lists just to use ARIA
Assign mismatched position and set size (e.g. item 6 of 3)
Store a Number type and assume AT will coerce it
Use aria-posinset without aria-setsize on set members
Forget to update positions after drag-and-drop reorder
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about ariaPosInSet
Reflected aria-posinset string for position in a set.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
String integer
"1" "2" "3"
Type
🔍03
Prefer ul/ol
when possible
MDN
✅04
Baseline
widely available
Status
🎯05
aria-setsize
pair on each item
Use
❓ Frequently Asked Questions
It reflects the aria-posinset attribute as a string containing an integer — the element's number or position in the current set of listitems or treeitems.
No. MDN marks Element.ariaPosInSet as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
Use aria-posinset together with aria-setsize on each item in the set. ariaPosInSet is the position; ariaSetSize (or aria-setsize) is the total count in the set.
The property is a string containing an integer (for example "2" or "3"), not a JavaScript number type.
MDN reads aria-posinset="2" from article2 via ariaPosInSet, then assigns "3" to update the reflected attribute.
When items are not in a native ordered list but assistive technology should still announce position (for example item 2 of 5). Prefer native ul/ol when the DOM already expresses order.
Did you know?
aria-posinset applies to listitems and treeitems in a set. Pair it with aria-setsize so assistive technology can announce both position and total count. Still start with the simplest native HTML that matches your structure.