3 <title>autofocus attribute test
</title>
4 <script language=
"JavaScript" type=
"text/javascript">
5 function log(message
) {
6 document
.getElementById("console").innerHTML
+= "<li>"+message
+"</li>";
10 if (window
.testRunner
)
11 testRunner
.dumpAsText();
13 var a
= document
.getElementsByTagName("input");
14 for (i
= 0; i
< a
.length
; i
++)
15 a
.item(i
).autofocus
? log("YES") : log("NO");
19 <body onload=
"test()">
20 <p>This test checks for the autofocus attribute. Autofocus is set on the first
21 and on the third input. Success on
"YES NO YES".
</p>
22 <input autofocus
id=
"one"/>
26 <ol id=
"console"></ol>