Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. Web API
  3. Element
  4. Element:ariaPosInSet 属性

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

Element:ariaPosInSet 属性

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.

Element 接口的ariaPosInSet 属性反射aria-posinset 属性的值。该属性定义了当前列表项或树形结构中元素的编号或位置。

一个包含整型的字符串。

示例

在本示例中,ID 为article2 的元素上的aria-posinset 属性被设置为“2”。通过使用ariaPosInSet,我们将该值更新为“3”。

html
<article aria-posinset="1">…</article><article aria-posinset="2">…</article>
js
let el = document.getElementById("article2");console.log(el.ariaPosInSet); // “2”el.ariaPosInSet = "3";console.log(el.ariaPosInSet); // “3”

规范

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariaposinset

浏览器兼容性

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp