| <title>basic "autofocus" test</title> |
| input:focus { background:lime } |
| <script src="../../resources/js-test-pre.js"></script> |
| <script language="JavaScript" type="text/javascript"> |
| window.jsTestIsAsync = true; |
| document.getElementById("input1").type = "password"; |
| function elementFocus() { |
| document.getElementById("input1").type = "text"; |
| document.getElementById("input2").focus(); |
| shouldBe('document.activeElement', 'document.getElementById("input2")'); |
| <input id="input1" type="text" autofocus onblur="elementBlur()" onfocus="elementFocus()"/> |
| <p>This form control should have a green background and active state:<input id="input2"> |
| <script src="../../resources/js-test-post.js"></script> |