Element: thuộc tính ariaSetSize

Baseline 2023
Newly available

Since October 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Thuộc tính ariaSetSize của giao diện Element phản ánh giá trị của thuộc tính aria-setsize, định nghĩa số lượng mục trong một nhóm hoặc tập hợp hiện tại.

Giá trị

Một chuỗi chứa một số nguyên, hoặc "0" nếu không xác định.

Ví dụ

Trong ví dụ này, thuộc tính aria-setsize trên phần tử có ID là tree-item được đặt là "5". Sử dụng ariaSetSize, chúng ta cập nhật giá trị thành "7".

html
<div role="tree">
  <div role="treeitem" id="tree-item" aria-setsize="5" aria-posinset="2">
    Mục cây
  </div>
</div>
js
let el = document.getElementById("tree-item");
console.log(el.ariaSetSize); // "5"
el.ariaSetSize = "7";
console.log(el.ariaSetSize); // "7"

Đặc tả kỹ thuật

Thông số kỹ thuật
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariasetsize

Trình duyệt hỗ trợ

Xem thêm