I have multiple text fields in my form and I want when user enters data in one text field and press enter that the cursor moves to another text-field which is next to curren
$("input").keypress(function(e) { if (e.which == 13) { var index = $("input[type='text']").index(this); $("input[type='text']").eq(index + 1).focus(); e.preventDefault(); } });
It worked perfectly for me and supports almost every jquery versions!