Main content

aria-setsize

Characteristics

Type:

  • Number

Used in Roles:

  • listitem
  • option

Inherits into Roles:

  • menuitemradio
  • radio
  • treeitem

See Related:

  • aria-posinset

Value:

  • integer

Sets or retrieves the set size of this element. Not required if all elements in the set are present in the DOM.

This property is marked on the members of a set, not the container element that collects the members of the set. To orient the user by saying an element is "item X out of Y," the assistive technologies would use X equal to the aria-posinset attribute and Y equal to the aria-setsize attribute.

If all items in a set are present in the document structure, it is not necessary to set this property, as the user agent can automatically calculate the set size and position for each item. However, if only a portion of the set is present in the document structure at a given moment (in order to reduce document size), this property is needed to provide an explicit indication of set size.

The following example shows items 5 through 8 in a set of 16.

<h2 id="label_fruit"> Available Fruit </h2>
<ul role="listbox" aria-labelledby="label_fruit">
  <li role="option" aria-setsize="16" aria-posinset="5"> apples </li>
  <li role="option" aria-setsize="16" aria-posinset="6"> bananas </li>
  <li role="option" aria-setsize="16" aria-posinset="7"> cantaloupes </li>
  <li role="option" aria-setsize="16" aria-posinset="8"> dates </li>
</ul>

Authors should use aria-setsize in conjunction with aria-posinset.

Note  For cross-browser compatibility, always use the aria attribute syntax to access and modify aria properties, for example object.setAttribute("aria-valuenow", newValue).

Syntax

HTML
<element aria-setsize="p" ... >
JavaScript
object.setAttribute("aria-setsize",value);var value = object.getAttribute("aria-setsize");

Microsoft Active Accessibility Properties:

  • N/A

UI Automation Properties: 

  • N/A (child count in automation element tree structure)

UI Automation AriaProperties Property:

  • setsize
More in this category: « aria-required aria-sort »