the following line of jQuery let's you detect when an enter key was pressed while focus was on a text input element.
$('input[type=text]').keyup(function(e) { if(e.keyCode == 13) { alert('Enter key detected with jquery'); } });
Or you can use the live method to bind the keyup handler to future additions to the DOM:
$('.someClass').live('keyup',function(e){ if(e.keyCode == 13) { alert('Enter key detected with jquery'); } });