The accesskey
attribute sets one or more
keyboard shortcuts that will select the element.
accesskey
attributes are added to three input elements.
This enables users to use keyboard shortcuts to move between used elements.
The key combination required to trigger the accesskey setting differs between platforms.
For Windows, it is the Alt key and the accesskey value pressed together.
<element accesskey="character">
accesskey |
Yes | Yes | Yes | Yes | Yes |
The following code uses accesskey
attribute in a simple form.
<!DOCTYPE HTML>
<html>
<body>
<form>
Name: <input type="text" name="name" accesskey="n"/>
<p/>
Password: <input type="password" name="password" accesskey="p"/>
<p/>
<input type="submit" value="Log In" accesskey="s"/>
</form>
</body>
</html><!-- w ww . j a v a 2 s.c o m-->