Переход к следующему input полю при нажатии кнопки Enter
Задача: есть таблица, в каждой ячейке которой находится поле input. Необходимо чтобы после ввода данных в поле и нажатии Enter проиходил переход на следующую ячейку
Решение:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |  $('body').on('keydown', 'input, select', function(e) {                     if (e.key === "Enter") {                 var self = $(this), form = self.parents('table:eq(0)'), focusable, next;                 focusable = form.find('input,textarea').filter(':visible');                 next = focusable.eq(focusable.index(this)+1);                 if (typeof next!=undefined){                     if (typeof next[0]!=undefined){                         if (next[0].disabled==true){                             next = focusable.eq(focusable.index(this)+3);                             };                         if (next.length) next.focus();                     };                 };                 return false;             }     });     |