I need to detect when someone hits "enter" in text inputs with a specific class.
My jQuery is as follows:
$('input.large').keypress(function (e) {
if(e.which ==13)
console.log("pressed enter");
});
My HTML is something like this:
<tr><td> Personal Name </td></tr>
<tr><td> <input type='text' class='large'> </td></tr>
<tr><td> Email</td></tr>
<tr><td> <input type='text' class='large'> </td></tr>
When I've given the fields IDs and tried $('#elementid').keypress
it worked. But this isn't working. I get no console output. What am I missing?