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”
规范
| 规范 |
|---|
| Accessible Rich Internet Applications (WAI-ARIA)> # dom-ariamixin-ariaposinset> |