HTML input attribute "accesskey" browser compatibility

Which browsers use the input attribute " accesskey"?
Is the behavior a cross-browser consistent?
Is it safe to use accesskeybecause asometimes only an additional data attribute is used in the tag (for example, " rel" and " rev)?

Also, is there a way to capture "onaccesskeypress" in JavaScript? Does this just fire the onclick event?

+3
source share
3 answers

accesskeyhas a rather spotty implementation. Firefox allows you to use any character as a value accesskey, while Safari seems to only allow numeric characters (for example, on this page ).

The next button maps to the access key >. It works on Firefox ( Ctrl >, on Mac), but not on Safari.

In my opinion, if keyboard navigation is important for your web page, using JavaScript is a much better option.

Some resources I came to my conclusions.

EDIT: , , Safari , - . Ctrl Alt {ACCESSKEY}. , JavaScript - , , .

+2

:

accesskey. , , HTML ( HTML5).

:

, accesskey .

, - , , " ", " ", " " .., . .

, , .

, .

accesskey :

, "". , :

<a accesskey="9" href="/sitemap.html">Sitemap</a>

:

0 -

9 -

8 - ( )

1,2,3... - ,

+2

Each main browser supportsaccesskey (analyzes it and assigns keyboard shortcuts accordingly).

The problem is that the control key is different for each browser. In Internet Explorer, this is Alt+ key, Firefox uses Shift+ Alt+ key, Mac uses Ctrl+ key.

0
source

All Articles