Element: ariaPosInSet 屬性
Element 介面的 ariaPosInSet 屬性反映了 aria-posinset 屬性的值,該屬性定義了一個元素在當前列表項集或樹項集中的編號或位置。
值
包含整數的字串。
示例
在此示例中,ID 為 article2 的元素上的 aria-posinset 屬性設定為“2”。使用 ariaPosInSet,我們將值更新為“3”。
html
<article id="article1" aria-posinset="1">…</article>
<article id="article2" aria-posinset="2">…</article>
js
let el = document.getElementById("article2");
console.log(el.ariaPosInSet); // "2"
el.ariaPosInSet = "3";
console.log(el.ariaPosInSet); // "3"
規範
| 規範 |
|---|
| 無障礙富網際網路應用程式 (WAI-ARIA) # dom-ariamixin-ariaposinset |
瀏覽器相容性
載入中…