JavaScript EditorBest javascript editor debugger     Ajax website 

Main Page

Previous Page
Next Page

Adding Keyboard Shortcuts

Keyboard shortcuts let your visitors select and activate links without using a mouse.

To add a keyboard shortcut to a form element:

Inside the form element's tag, type accesskey=".

Type the keyboard shortcut (any letter or number).

Type the final ".

If desired, add information about the keyboard shortcut to the text so that the visitor knows that it exists.

Figure 17.56. Keyboard shortcuts can be especially helpful on mobile devices.

Figure 17.57. Pressing Ctrl-T (Alt-T on Windows) puts the cursor in the comments box.


  • Keyboard shortcuts are case-insensitive.

  • On Windows systems, to invoke the keyboard shortcut, visitors use the Alt key plus the letter you've assigned. On Macs, visitors use the Control key.

  • Explorer for Windows has supported keyboard shortcuts since version 4. Fire-fox and other Gecko browsers support them as well. Opera has its own keyboard navigation system and will ignore yours.

  • When a visitor uses a keyboard shortcut it not only gives the element the focus, but actually activates it. In the case of radio buttons and checkboxes, this means the item is selected. If it's a text box, the cursor is placed inside (after any existing text). If it's a button, the button is activated.

Previous Page
Next Page

JavaScript EditorBest javascript editor debugger     Ajax website