jQuery how to make Enter (Return) act as Tab key through input text fields but in the end trigger the submit button
问题 I've blocked Enter (return) key, actually, transformed it in Tab key. So when pressed inside input text fields it acts as Tab key. This is good, but I need it to trigger the submit button when pressed in the last field, below is the code for the Enter key mutation: $('input').keydown(function(event) { if(event.which == 13) { event.preventDefault(); $(this).nextAll('input:first').focus(); } }); And the form code is a sequence of input type="text" and a button type="submit" at the end [Edited]