I would like to detect whether the user has pressed Enter using jQuery.
How is this possible? Does it require a plugin?
EDIT: It looks like I need
I couldn't get the code posted by @Paolo Bergantino to work but when I changed it to $(document) and e.which instead of e.keyCode then I found it to work faultlessly.
$(document)
e.which
e.keyCode
$(document).keypress(function(e) { if(e.which == 13) { alert('You pressed enter!'); } });
Link to example on JS Bin