18.5. Setting a Shortcut Key for an Anchor Link in XHTML MP
The accesskey attribute of the <a> tag is used to set a shortcut key for an anchor link. Valid attribute values are *, #, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
The following XHTML MP example demonstrates how to set a shortcut key using the accesskey attribute:
<?xml
version="1.0"?>
<!DOCTYPE html PUBLIC
"-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XHTML
MP Tutorial</title>
</head>
<body>
<p>
This
is page 1.<br/>
<a accesskey="1"
href="linksEg7.xhtml"><img src="to2.gif"
alt="Go to linksEg7.xhtml"/></a>
</p>
</body>
</html>
<?xml
version="1.0"?>
<!DOCTYPE html PUBLIC
"-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XHTML
MP Tutorial</title>
</head>
<body>
<p>
This
is page 2.<br/>
<a accesskey="1"
href="linksEg6.xhtml"><img src="to1.gif"
alt="Go to linksEg6.xhtml"/></a>
</p>
</body>
</html>
If you view the above two XHTML MP documents in a mobile phone browser, you will see that the anchor link is activated automatically when you press the "1" key of the mobile phone's keypad.
It should be noted that if the above XHTML MP example is viewed on Internet Explorer of a PC, the anchor link will be set in focus but will not be activated automatically when the shortcut "Alt + 1" is pressed.
The -wap-accesskey property of WAP CSS can be used as an alternative of the accesskey attribute.
Previous Page | Page 27 of 36 | Next Page |
- 1. XHTML MP (XHTML Mobile Profile) Introduction
- 2. Development of Wireless Markup Languages
- 3. Advantages of XHTML MP
- 4. WML Features Lost in XHTML MP
- 5. Syntax Rules of XHTML MP
- 6. XHTML MP MIME Types and File Extension
- 7. XHTML MP Document Structure
- 8. XHTML MP Generic Metadata
- 9. Comments in XHTML MP
- 10. Line Breaking in XHTML MP
- 11. XHTML MP Horizontal Rules
- 12. XHTML MP Headings
- 13. Font Style in XHTML MP
- 14. XHTML MP Preformatted Text
- 15. XHTML MP Lists
- 16. XHTML MP Images
- 17. XHTML MP Tables
- 18. Anchor Links in XHTML MP
- 19. XHTML MP Selection Lists
- 20. XHTML MP Input Elements
- 21. Submitting Form Data to the Server in XHTML MP