Element.ariaSetSize is an instance property that reflects the aria-setsize attribute. Learn how it declares the total number of items in a set, how it pairs with ariaPosInSet, and how to get or set it from JavaScript—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String (integer)
03
Meaning
Total items in set
04
Reflects
aria-setsize
05
Status
Baseline widely
06
Pairs with
ariaPosInSet
Fundamentals
Introduction
Screen readers often announce “item 2 of 5” or “tab 1 of 3.” The “of N” part is the set size—how many items belong to the group.
aria-setsize declares that total. The DOM property ariaSetSize lets you read and update it from JavaScript.
JavaScript
const el = document.getElementById("tab-id");
console.log(el.ariaSetSize); // "3"
el.ariaSetSize = "4";
💡
Beginner tip
Prefer native lists (<ul> / <ol>) when the DOM already expresses order and size. Use ariaSetSize for custom widgets, tabs, trees, or virtualized sets where not every item is in the DOM.
Concept
Understanding the Property
MDN: the ariaSetSize property of the Element interface reflects the value of the aria-setsize attribute, which defines the number of items in the current set of listitems or treeitems.
Reflected attribute — mirrors aria-setsize.
Get / set — readable and writable string integer.
Total count — how many items belong to the set.
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaSetSize
Value
A string which contains an integer (the number of items in the set).
Item
Detail
Type
string containing an integer (e.g. "3")
Reflects
aria-setsize
Applies to
listitem, treeitem, tab, and similar set members
Pair with
aria-posinset / ariaPosInSet
⚠️
Position + total
ariaPosInSet is “which number am I?” ariaSetSize is “how many are there?” Set both on each item for clear “N of M” announcements.
Pattern
📋 MDN Tab Example Shape
MDN starts with a tab marked aria-setsize="3" (three tabs in the group), then updates ariaSetSize to "4":
Element.ariaSetSize 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.ariaSetSize
String integer — reflects aria-setsize (total items in the set).
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 ariaSetSize IDL — use setAttribute
No
ariaSetSizeBaseline
Bottom line: Use ariaSetSize to get/set aria-setsize. Pair with ariaPosInSet for clear N-of-M announcements. Prefer native HTML lists when you can. Keep the value as a string integer such as "3" or "4".
Wrap Up
Conclusion
ariaSetSize reflects aria-setsize so set members can declare how many items belong to the group. Use string integers, pair with ariaPosInSet, and prefer native lists when that is enough.
Use aria-setsize without aria-posinset on set members
Put different totals on siblings in the same set
Rebuild native lists with ARIA without need
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about ariaSetSize
Reflected aria-setsize string for how many items are in the set.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
String integer
total count
Type
🔍03
List · tab · tree
set members
Use
✅04
Baseline
widely available
Status
🎯05
+ posinset
N of M pair
Tip
❓ Frequently Asked Questions
It reflects the aria-setsize attribute as a string containing an integer that defines the number of items in the current set of listitems or treeitems (and similar sets such as tabs).
No. MDN marks Element.ariaSetSize as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
A string that contains an integer (for example "3" or "4"), not a Number type.
Use aria-setsize together with aria-posinset on each item. ariaSetSize is the total count; ariaPosInSet is the item’s position in that set.
When the full set is not all in the DOM at once (virtualized lists) or when custom widgets are not native lists, so assistive technologies still know the total size.
Yes. Reading and writing ariaSetSize updates the reflected aria-setsize attribute.
Did you know?
MDN’s demo puts aria-setsize on a selected tab with aria-controls—so AT learns both selection and how many tabs exist in the group.