Element: thuộc tính ariaDisabled
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 ariaDisabled của giao diện Element phản chiếu giá trị của thuộc tính aria-disabled, cho biết phần tử có thể nhận biết nhưng bị vô hiệu hóa, vì vậy nó không thể chỉnh sửa hoặc hoạt động khác.
Giá trị
Một chuỗi với một trong các giá trị sau:
Ví dụ
Trong ví dụ này, thuộc tính aria-disabled trên phần tử có ID saveChanges được đặt thành "true" cho biết đầu vào này hiện đang bị vô hiệu hóa. Sử dụng ariaDisabled chúng ta cập nhật giá trị thành "false".
html
<div id="saveChanges" tabindex="0" role="button" aria-disabled="true">Save</div>
js
let el = document.getElementById("saveChanges");
console.log(el.ariaDisabled); // "true"
el.ariaDisabled = "false";
console.log(el.ariaDisabled); // "false"
Đặc tả kỹ thuật
| Specification |
|---|
| Accessible Rich Internet Applications (WAI-ARIA)> # dom-ariamixin-ariadisabled> |