Element: ariaOrientation 屬性
Element 介面的 ariaOrientation 屬性反映了 aria-orientation 屬性的值,該屬性指示元素的朝向是水平、垂直還是未知/模糊。
值
一個字串,其值可能為以下之一:
"horizontal"-
該元素是水平的。
"vertical"-
該元素是垂直的。
"undefined"-
該元素的朝向未知。
示例
在此示例中,ID 為 handle_zoomSlider 的元素上的 aria-orientation 屬性設定為 "vertical"。使用 ariaOrientation,我們將值更新為 "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"
規範
| 規範 |
|---|
| 無障礙富網際網路應用程式 (WAI-ARIA) # dom-ariamixin-ariaorientation |
瀏覽器相容性
載入中…