Element: ariaMultiSelectable 屬性
Element 介面的 ariaMultiSelectable 屬性反映了 aria-multiselectable 屬性的值,該屬性指示使用者可以從當前可選擇的後代元素中選擇多個專案。
注意: 如果可能,請使用 HTML <select> 元素,因為它具有內建的語義,不需要 ARIA 屬性。
值
一個字串,其值可能為以下之一:
示例
在此示例中,ID 為 listbox1 的元素上的 aria-multiselectable 屬性設定為 "true",表明此輸入接受多個選定的專案。使用 ariaMultiSelectable,我們將值更新為 "false"。
html
<div
role="listbox"
tabindex="0"
id="listbox1"
aria-multiselectable="true"
aria-labelledby="listbox1label"
aria-activedescendant="listbox1-1">
<div role="option" id="listbox1-1" class="selected" aria-selected="true">
Green
</div>
<div role="option" id="listbox1-2">Orange</div>
<div role="option" id="listbox1-3">Red</div>
</div>
js
let el = document.getElementById("listbox1");
console.log(el.ariaMultiSelectable); // "true"
el.ariaMultiSelectable = "false";
console.log(el.ariaMultiSelectable); // "false"
規範
| 規範 |
|---|
| 無障礙富網際網路應用程式 (WAI-ARIA) # dom-ariamixin-ariamultiselectable |
瀏覽器相容性
載入中…