Element: thuộc tính ariaValueText

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 ariaValueText của giao diện Element phản ánh giá trị của thuộc tính aria-valuetext, định nghĩa văn bản thay thế dễ đọc cho con người của aria-valuenow cho một widget khoảng.

Giá trị

Một chuỗi.

Ví dụ

Trong ví dụ này, thuộc tính aria-valuetext trên phần tử có ID là slider được đặt là "Sunday" để cung cấp giá trị dễ đọc cho con người của khoảng. Sử dụng ariaValueText, chúng ta cập nhật giá trị thành "Monday".

html
<div
  id="slider"
  role="slider"
  aria-valuenow="1"
  aria-valuemin="1"
  aria-valuemax="7"
  aria-valuetext="Sunday"></div>
js
let el = document.getElementById("slider");
console.log(el.ariaValueText); // "Sunday"
el.ariaValueText = "Monday";
console.log(el.ariaValueText); // "Monday"

Đặc tả kỹ thuật

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

Trình duyệt hỗ trợ

Xem thêm