Element: ariaBrailleLabel 屬性
Element 介面的 ariaBrailleLabel 屬性反映了 aria-braillelabel 屬性的值,該屬性定義了元素的 ARIA 盲文標籤。
此元素標籤可能被能夠以盲文顯示內容的輔助技術使用,但僅應在特定於盲文的標籤可以改善使用者體驗時設定。 aria-braillelabel 包含有關何時應設定該屬性的更多資訊。
值
<string>-
該值是一個字串,一種無約束的值型別,旨在轉換為盲文。
示例
獲取和設定 ariaBrailleLabel
此示例展示瞭如何獲取和設定 ariaBrailleLabel 屬性。
HTML
首先,我們定義一個帶有標籤文字“3 out of 5 stars”和一個值為 "\*\*\*" 的 aria-braillelabel 屬性的按鈕。這允許盲文顯示以盲文顯示“btn ***”,而不是更冗長的“btn gra 3 out of 5 stars”。
html
<button id="button" aria-braillelabel="\*\*\*">3 out of 5 stars</button>
JavaScript
然後,程式碼使用按鈕的 ariaBrailleLabel 屬性首先獲取並記錄盲文標籤。然後它將盲文標籤設定為“3*”並再次記錄該值。
js
const button = document.getElementById("button");
log(button.ariaBrailleLabel);
button.ariaBrailleLabel = "3*";
log(button.ariaBrailleLabel);
結果
規範
| 規範 |
|---|
| 無障礙富網際網路應用程式 (WAI-ARIA) # dom-ariamixin-ariabraillelabel |
瀏覽器相容性
載入中…