Theoretical question


In this excercise Code Academy says the following:
'After setting up with $(document).ready(), call the .keydown() event on $(document). (We want the whole document object to respond whenever a key is pressed.)'
This doesnt seem logical to me: In what wat do we want the whole document to respond? It is only a part of the document that will remove, right? I


I believe it's in reference to the fact that the keypress will only work if the element it's attached to is in focus - in this case, it's the entire page $(document).


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.