1 <html xmlns=
"http://www.w3.org/1999/xhtml">
3 <title>testing
"autofocus" in XHTML with dynamic changes (part two)
</title>
5 input { background:red }
6 input:focus { background:lime }
8 <script language=
"JavaScript" type=
"text/javascript">
9 function log(message
) {
10 document
.getElementById("console").innerHTML
+= "<li>"+message
+"</li>";
14 var input
= document
.getElementsByTagName('input')[0];
15 var p
= document
.getElementsByTagName('p')[0];
16 var input
= p
.removeChild(input
);
17 input
.autofocus
= true;
20 if (window
.layoutTestController
) {
21 layoutTestController
.dumpAsText();
22 layoutTestController
.waitUntilDone();
29 if (document
.activeElement
== document
.getElementsByTagName("input")[0])
34 if (window
.layoutTestController
)
35 layoutTestController
.notifyDone();
39 <body onload=
"test()">
40 <p>The form control should have a green background:
<input/></p>
42 <ol id=
"console"></ol>