Element: thuộc tính ariaRoleDescription

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 ariaRoleDescription của giao diện Element phản chiếu giá trị của thuộc tính aria-roledescription, định nghĩa một mô tả do tác giả bản địa hóa, dễ đọc cho con người về vai trò của một phần tử.

Giá trị

Một chuỗi.

Ví dụ

Trong ví dụ này, thuộc tính aria-roledescription trên phần tử có ID myApplication đã được thiết lập. Sử dụng ariaRoleDescription chúng ta có thể cập nhật giá trị.

html
<div
  id="myApplication"
  role="application"
  aria-roledescription="a description of this widget">
  …
</div>
js
let el = document.getElementById("myApplication");
console.log(el.ariaRoleDescription); // "a description of this widget"
el.ariaRoleDescription = "an updated description of this widget";
console.log(el.ariaRoleDescription); // "an updated description of this widget"

Đặc tả kỹ thuật

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

Tương thích trình duyệt

Xem thêm