I have some textboxes on a .net-page and want to achieve the following with jQuery: if the user presses return, the program should behave \"as if\" he had used the tab key,
From multiple answers I have combined the perfect solution for me where enter acts as tab on inputs and select and takes focus on next input, select or textarea while allows enter inside text area.
$("input,select").bind("keydown", function (e) {
var keyCode = e.keyCode || e.which;
if(keyCode === 13) {
e.preventDefault();
$('input, select, textarea')
[$('input,select,textarea').index(this)+1].focus();
}
});