Theoretical question


#1

https://www.codecademy.com/en/courses/web-beginner-en-JwhI1/1/4?curriculum_id=50a3fad8c7a770b5fd0007a1

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


#2

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).


#3

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