Accesskey not working

It really shouldn’t be this hard.

Clicking on each link works – every combination of alt/ctrl/shift + 1 does not.

What is my illiteracy? (Code passes W3C validator).

<?xml version="1.0" <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "">

<html xmlns="">
    <title>Scheduler Welcome</title>
	<!-- set cache to 5 minutes (300 seconds) -->
	<meta http-equiv="Cache-Control" content="max-age=300" />

  <div id="notneeded">
    <p>Type the number (or click) your selection</p>
  		<li><a accesskey="1" href="" >One</a></li>
  		<li><a href="#two" accesskey="2">Two</a></li>
  		<li><a href="#three" accesskey="3">Three</a></li>
  		<li><a href="#four" accesskey="4">Four</a></li>
  		<li><a href="#five" accesskey="5">Five</a></li>
  		<li><a href="#six" accesskey="6">Six</a></li>
  		<li><a href="#seven" accesskey="7">Seven</a></li>
	<div id="trythis">
<a id="one"></a><p>This is one</p>
<a id="two"></a><p>This is two</p>
<a id="three"></a><p>This is three</p>
<a id="four"></a><p>This is four</p>
<a id="five"></a><p>This is five</p>
<a id="six"></a><p>This is six</p>
<a id="seven"></a><p>This is seven</p>

I’ve also tried it with the normal

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="" lang="en">

as opposed to the mobile.

What am I not seeing? (Firefox 4.0.1. IE 8.0)


Your code works OK for me on Mac. This page explains the keystrokes for the various browsers:

accesskey (HTML attribute)

The key combination that activates the link to which the accesskey is applied varies depending on the platform and browser combination. For IE/Windows, users press Alt + accesskey, while Firefox/Windows users press Alt + Shift + accesskey; users of most Mac browsers press Ctrl + accesskey; in Opera, pressing Shift + Esc displays a list of links for which accesskey attributes are defined, allowing users to choose the key they want to use.

That explains it. Surprising. Thank you.

I’m just asking what the devil you are wasting the anchors on when you are using ID’s… Still worried about netscape 4 or something?

<p id="one">This is one</p>
<p id="two">This is two</p>
<p id="three">This is three</p>
<p id="four">This is four</p>
<p id="five">This is five</p>
<p id="six">This is six</p>
<p id="seven">This is seven</p>

Would work just as well – that’s part of why we have ID’s, so we can get rid of the pointless anchors.

Oh, and in browsers like Opera and Blazer which allow for accesskeys menus, you can use the TITLE attribute on those anchors to customize the text used in said menu, instead of them showing the URL. (Which IMHO is the ONLY time there’s a legitimate reason for putting TITLE on an anchor…)