6 var item
= document
.createElement("li");
7 item
.appendChild(document
.createTextNode(message
));
8 document
.getElementById("console").appendChild(item
);
10 function pressKey(key
)
12 if (navigator
.userAgent
.search(/\bMac OS X\b/) != -1)
13 modifiers
= ["ctrlKey", "altKey"];
15 modifiers
= ["altKey"];
16 eventSender
.keyDown(key
, modifiers
);
20 if (window
.testRunner
) {
21 testRunner
.dumpAsText();
23 for (i
= 1; i
<= 9; i
++)
24 pressKey(i
.toString());
34 <body onload=
"test()">
35 <p>This test checks to see if accesskey attributes works on the specified elements.
</p>
36 <p>If this test passes you should see
1 -
9 and a, b and c clicked or focussed.
</p>
39 <button accesskey=
"1" onfocus=
"log('1 button focussed')" onclick=
"log('1 button clicked')"></button>
40 <input type=
"button" value=
"Click me!" accesskey=
"2" onfocus=
"log('2 input type button focussed')" onclick=
"log('2 input type button clicked')">
41 <input type=
"checkbox" accesskey=
"3" onfocus=
"log('3 input type checkbox focussed')" onclick=
"log('3 input type checkbox clicked')">
42 <input type=
"text" accesskey=
"4" onfocus=
"log('4 input type text focussed')" onclick=
"log('4 input type text clicked')">
43 <input type=
"submit" accesskey=
"5" onfocus=
"log('5 input type submit focussed')" onclick=
"log('5 input type submit clicked')">
44 <input type=
"reset" accesskey=
"6" onfocus=
"log('6 input type reset focussed')" onclick=
"log('6 input type reset clicked')">
45 <a href=
"#" accesskey=
"7" onfocus=
"log('7 link focussed')" onclick=
"log('7 link clicked')"></a>
46 <fieldset><legend accesskey=
"8"></legend><input type=
"text" onfocus=
"log('8 input type associated to legend focussed')" onclick=
"log('8 input type associated to legend clicked')"></fieldset>
47 <label accesskey=
"9" for=
"test1"><input type=
"text" id=
"test1" onfocus=
"log('9 input type associated to label around input focussed')" onclick=
"log('9 input type associated to label around input clicked')"></label>
48 <label accesskey=
"a" for=
"test2"></label><input type=
"text" id=
"test2" onfocus=
"log('a input type associated to label closed before input focussed')" onclick=
"log('a input type associated to label closed before input clicked')">
50 <area accesskey=
"b" shape=
"rect" coords=
"0,0,5,10" alt=
"" href=
"#" onfocus=
"log('b area 1 focussed')" onclick=
"log('b area 1 clicked')">
51 <area accesskey=
"c" shape=
"rect" coords=
"6,0,10,10" alt=
"" href=
"#" onfocus=
"log('c area 2 focussed')" onclick=
"log('c area 2 clicked')">
53 <img usemap=
"#mymap" alt=
"pic" src=
"#" height=
"10" width=
"10">
54 <select accesskey=
"d" onfocus=
"log('d select focussed')" onclick=
"log('d select clicked')"></select>
55 <textarea accesskey=
"e" onfocus=
"log('e textarea focussed')" onclick=
"log('e textarea clicked')"></textarea>
58 <ol id=
"console"></ol>