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.

HTML, XHTML, & CSS(c) Visual QuickStart Guide
HTML, XHTML, and CSS, Sixth Edition
ISBN: 0321430840
EAN: 2147483647
Year: 2004
Pages: 340

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: