summaryrefslogtreecommitdiffstats
path: root/dom/bindings/test/file_focuser.html
blob: 0d5240f95b1ad3b22a25a274b1355eb9c415ec49 (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
<!DOCTYPE HTML>
<div id="stage"></div>
<script>
  function stage(str) {
    var s = document.getElementById("stage");
    s.textContent = str;
  }
  stage("before");
  setTimeout(function() {
    stage("in timeout");
  });
  setInterval(function() {
    stage("in interval");
  });
  addEventListener("keydown", function() {
    stage("keydown");
  }, false);
  try {
    focus();
    stage("after");
  } catch(e) {
    stage("exception raised");
  }
</script>