I have an input field and a login button. I want to allow users to hit the “enter” key to click the button when the input field is focused. How would I do this with jQuery?
<input type="text" size="10" id="loginUserID" name="username">
<input type="button" value="Login" name="loginBtn" id="loginBtn">
Demo: http://jsfiddle.net/Bhf5a/