6

I assigned access key e to email input field in a simple html form. I am currently testing this in chrome. So on pressing Alt + e, instead of switching focus to the email input field, the Chrome menu get activated.

How should I go around with this? How to gain focus to the input element on pressing Alt + e.

Any ideas?

Thanks

mtk
  • 13,221
  • 16
  • 72
  • 112
  • Anything helpful here?: http://stackoverflow.com/questions/5061353/how-to-create-a-keyboard-shortcut-for-an-input-button ... else you should add some code. – Tim Vermaelen Jul 30 '12 at 18:27
  • What code should be added? so that the key combination pressed is catched by the web-page and not by the browser itself. Please elaborate. – mtk Jul 30 '12 at 18:33

2 Answers2

14

The implementation of accesskey attributes is browser-dependent, see some of the variation.

It also interferes with the built-in accesskey assignments that browsers or assistive software may have. It is therefore not recommended by accessibility specialists.

On my Chrome, an element with accesskey="e" attribute gets focused on, when I use Alt-Shift-E. But I would not have known if I had not checked it.

jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252
Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390
1
<a href="#U" id="AU" name="U" title="右上方功能區塊" accesskey="U" tabindex="3">:::</a>

Give it a name="U",and href="#U" name=href, and Chrome will work.

Machavity
  • 30,841
  • 27
  • 92
  • 100
C. Finny
  • 11
  • 2