Implement document focus context and hook it up to click events.

This commit is contained in:
Josh Matthews 2014-10-04 10:31:47 -04:00
parent 329ba56fca
commit 84bc17e7ad
4 changed files with 57 additions and 7 deletions

View file

@ -0,0 +1,7 @@
<body>
<input id="focused">
<script>
document.body.addEventListener('keydown', function() { alert("body"); }, false);
document.getElementById('focused').addEventListener('keydown', function() { alert("input"); }, false);
</script>
</body>