summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/button/button-enter-click.html
blob: 115c859dcf8bb65b9ce6ba814d37db4faa6f4f38 (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
<html>
<head>
    <script>
    function test() {
        var bt = document.getElementById('bt');
        bt.focus();
        if (window.testRunner) {
            testRunner.dumpAsText();
            eventSender.keyDown("\r", []);
        }
    }
    function log(msg) {
        var console = document.getElementById('console');
        console.innerHTML = console.innerHTML + msg + "<br>";
    }
    </script>
</head>
<body onload="test()">
    <form onsubmit="log('Test Passed'); return false;">
        This tests that hitting the enter key on a button element submits the form.<br>
        <button id="bt"></button>
    </form>
    <div id="console"></div>
</body>
</html>