3 <title>basic
"autofocus" test
</title>
5 input { background:red }
6 input:focus { background:lime }
8 <script src=
"../../resources/js-test.js"></script>
9 <script language=
"JavaScript" type=
"text/javascript">
10 window
.jsTestIsAsync
= true;
12 function elementBlur() {
13 document
.getElementById("input1").type
= "password";
15 function elementFocus() {
16 document
.getElementById("input1").type
= "text";
20 document
.getElementById("input2").focus();
21 shouldBe('document.activeElement', 'document.getElementById("input2")');
26 <body onload=
"test()">
27 <input id=
"input1" type=
"text" autofocus
onblur=
"elementBlur()" onfocus=
"elementFocus()"/>
29 <p>This form control should have a green background and active state:
<input id=
"input2">