We have to implement keyboard support for our browser based client. I have found two ways for implementing 1. By specifying "accesskey" attribute in HTML or 2. By supporting hotkeys via javascript
I am inclining to go with 1. because it's inbuild and standard, however I have observed most of websites going for 2.
Is there any particular reason for this ?
The main reason, or at least a good reason, is that the
accesskey
attribute is poorly designed, underspecified (the specification does not really say how it works), and inconsistently implemented in browsers.Moreover, the use of
accesskey
normally requires the user to use an Alt or Option key or equivalent in addition to a letter or digit key. This is not particularly good usability or accessibility.The only advantage of
accesskey
over scripted techniques is that it works when JavaScript is disabled. But this is seldom a real concern in applications or application-like web pages, since they don’t work without JavaScript anyway.