summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/autofocus-attribute.html
blob: 215bda40779148fd5d84fbab1e4d074e32773ef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
<head>
<title>autofocus attribute test</title>
<script language="JavaScript" type="text/javascript">
    function log(message) {
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
    }

    function test() {
        if (window.testRunner)
            testRunner.dumpAsText();
      
        var a = document.getElementsByTagName("input");
        for (i = 0; i < a.length; i++)
            a.item(i).autofocus ? log("YES") : log("NO");
    }
</script>
</head>
<body onload="test()">
<p>This test checks for the autofocus attribute. Autofocus is set on the first
and on the third input. Success on "YES NO YES".</p>
<input autofocus id="one"/>
<input/>
<input autofocus/>
<hr>
<ol id="console"></ol>
</body>
</html>