Element: ariaKeyShortcuts 屬性
Element 介面的 ariaKeyShortcuts 屬性反映了 aria-keyshortcuts 屬性的值,該屬性指示作者用於啟用或聚焦元素的鍵盤快捷鍵。
值
字串。
示例
在此示例中,ID 為 skip-link 的元素的 aria-keyshortcuts 屬性設定為 "Alt+Shift+A"。使用 ariaKeyShortcuts,我們將值更新為 "Alt+Shift+M"。
html
<a id="skip-link" href="#content" aria-keyshortcuts="Alt+Shift+A">
Skip to content
</a>
js
let el = document.getElementById("saveChanges");
console.log(el.ariaKeyShortcuts); // "Alt+Shift+A"
el.ariaKeyShortcuts = "Alt+Shift+M";
console.log(el.ariaKeyShortcuts); // "Alt+Shift+M"
規範
| 規範 |
|---|
| 無障礙富網際網路應用程式 (WAI-ARIA) # dom-ariamixin-ariakeyshortcuts |
瀏覽器相容性
載入中…