jQuery events: using .keydown - different code but still passed?


The grader wanted this code:



But it still passed my code:

$(document).ready(function () {

$(document)keydown(function () {




Is this just a difference of the model answer using shorthand compared to my code using longhand? Or, are these two pieces of code fundamentally different?



The unit is very introductory and not at all exhaustive, so it follows the SCT is going to be minimal, and may not examine edge cases. Clearly neither of the above would have passed a more stringent test.

That is placeholder text, not a actual keyword.

will result in an error since the dot is missing.


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