-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
114 lines (96 loc) · 5.55 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
title: accesskey
slug: Web/HTML/Global_attributes/accesskey
---
{{HTMLSidebar("Global_attributes")}}
[Глобальный атрибут](/ru/docs/Web/HTML/Global_attributes) **accesskey** даёт возможность быстро перейти к элементу с помощью комбинации клавиш. Значение атрибута состоит из одного печатного символа (в том числе спец. символы, акценты и другие, которые можно написать с клавиатуры).
{{EmbedInteractiveExample("pages/tabbed/attribute-accesskey.html","tabbed-shorter")}}
> [!NOTE]
> Спецификация WHATWG допускает использования нескольких символов разделённых пробелом. Однако, на момент написания, эта функциональность не поддерживается в современных браузерах. IE и Edge в таком случае будет использовать первый символ, игнорируя остальные.
Активация элементов с помощью Accesskey зависит от браузера и платформы:
<table class="standard-table">
<tbody>
<tr>
<th></th>
<th>Windows</th>
<th>Linux</th>
<th>macOS</th>
</tr>
<tr>
<th>Firefox</th>
<td colspan="2" rowspan="1" style="text-align: center">
<kbd>Alt</kbd>+ <kbd>Shift</kbd>+<kbd><em>key</em></kbd>
</td>
<td>
В Firefox 57 и новее: <kbd>Control</kbd> + <kbd>Option</kbd> +
<kbd><em>key</em></kbd> -OR- <kbd>Control</kbd> + <kbd>Alt</kbd> +
<kbd><em>key</em></kbd
><br />В Firefox 14 и новее: <kbd>Control</kbd>+ <kbd>Alt</kbd>+
<kbd><em>key</em></kbd
><br />В Firefox 13 и старше, <kbd>Control</kbd>+<kbd><em>key</em></kbd>
</td>
</tr>
<tr>
<th>Internet Explorer</th>
<td>
<kbd>Alt</kbd> + <kbd><em>key</em></kbd>
</td>
<td colspan="2" rowspan="1">N / A</td>
</tr>
<tr>
<th>Google Chrome</th>
<td colspan="2" rowspan="1" style="text-align: center">
<kbd>Alt</kbd> + <kbd><em>key</em></kbd>
</td>
<td>
<kbd>Control</kbd>+ <kbd>Alt</kbd>+<kbd><em>key</em></kbd>
</td>
</tr>
<tr>
<th>Safari</th>
<td>
<kbd>Alt</kbd> + <kbd><em>key</em></kbd>
</td>
<td>N / A</td>
<td>
<kbd>Control</kbd>+ <kbd>Alt</kbd>+<kbd><em>key</em></kbd>
</td>
</tr>
<tr>
<th>Opera 15+</th>
<td colspan="2" rowspan="1" style="text-align: center">
<kbd>Alt</kbd> + <kbd><em>key</em></kbd>
</td>
<td>
<kbd>Control</kbd>+ <kbd>Alt</kbd>+<kbd><em>key</em></kbd>
</td>
</tr>
<tr>
<th>Opera 12</th>
<td colspan="3" rowspan="1">
<kbd>Shift</kbd>+ <kbd>Esc</kbd> показывает список элементов, доступных
для быстрого перехода. Перейти на нужный элемент можно нажав
соответствующий символ (<kbd><em>key</em></kbd
>)
</td>
</tr>
<tr></tr>
</tbody>
</table>
Обратите внимание, что в Firefox пользователь может настроить свой модификатор активации.
## Проблемы с доступностью
В добавок к слабой поддержке браузерами всех возможностей в спецификации, у атрибута `accesskey` есть проблемы с доступностью:
- Значение атрибута `accesskey` может конфликтовать с комбинациями клавиш системы, браузера или вспомогательными инструментами доступности.
- Определённые значения атрибута `accesskey` могут отсутствовать на некоторых клавиатурах. Это особенно сильно проявляется, если вы используете язык отличный от английского.
- Числовые значения атрибута могут `accesskey` затруднить работу с сайтом для людей с расстройствами мышления. Например, когда числовые значения не имеют логической связи со связанным элементом.
- Не существует стандартизированного способа информировать пользователя о наличии атрибута `accesskey` на элементе. Неинформированный пользователь может случайно активировать элемент с атрибутом `accesskey`.
Ввиду этих причин рекомендуется не использовать атрибут `accesskey` для обычных сайтов и веб-приложений.
- [WebAIM: Keyboard Accessibility - Accesskey](https://webaim.org/techniques/keyboard/accesskey#spec)
## Спецификации
{{Specifications}}
## Совместимость с браузерами
{{Compat}}
## Смотрите также
- {{domxref("Element.accessKey")}}
- {{domxref("HTMLElement.accessKeyLabel")}}
- Все [глобальные атрибуты](/ru/docs/Web/HTML/Global_attributes) .