Element: thuộc tính ariaOrientation
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 ariaOrientation của giao diện Element phản chiếu giá trị của thuộc tính aria-orientation, cho biết liệu hướng của phần tử là ngang, dọc hay không rõ ràng/có thể gây nhầm lẫn.
Giá trị
Một chuỗi với một trong các giá trị sau:
"horizontal"-
Phần tử có hướng ngang.
"vertical"-
Phần tử có hướng dọc.
"undefined"-
Hướng của phần tử không rõ.
Ví dụ
Trong ví dụ này, thuộc tính aria-orientation trên phần tử có ID handle_zoomSlider được đặt thành "vertical". Sử dụng ariaOrientation chúng ta cập nhật giá trị thành "horizontal".
html
<div
id="handle_zoomSlider"
role="slider"
aria-orientation="vertical"
aria-valuemin="0"
aria-valuemax="17"
aria-valuenow="14"
tabindex="0">
<span>11</span>
</div>
js
let el = document.getElementById("handle_zoomSlider");
console.log(el.ariaOrientation); // "vertical"
el.ariaOrientation = "horizontal";
console.log(el.ariaOrientation); // "horizontal"
Đặc tả kỹ thuật
| Specification |
|---|
| Accessible Rich Internet Applications (WAI-ARIA)> # dom-ariamixin-ariaorientation> |