close

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

Element: ariaKeyShortcuts プロパティ

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2023年10月.

ariaKeyShortcutsElement インターフェイスのプロパティで、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"

仕様書

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariakeyshortcuts

ブラウザーの互換性