Jump to content

[SOLVED] jQuery keypress not working for document selector


gevans

Recommended Posts

Hey guys,

 

Title pretty much says it all, I have a couple of snippets accessing the same function (i.e. the function works fine). But when I try to execute the function on a keypress I don't get anything.

 

$(document).keypress(function(e) { if(e.which === 27) { closePopup(); } });

 

I can't see what I'm missing. If anyone has any ideas I'd love to know,

 

Cheers

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.