JSFiddle - React, Tailwind, and code Playground

by rudygotya

HTML

<table id="locationsTable">
<tbody>
<tr>
<td class="loc l40 ">Estonia</td>
<td class="loc l40 " style="text-indent: 0; padding:0;">
<input id="input_39_21_1_2011_Orders_a" class="" type="text" value=""></td>
</tr>
<tr>
<td class="loc l40 ">Latvia</td>
<td class="loc l40 " style="text-indent: 0; padding:0;">
<input id="input_40_21_1_2011_Orders_a" type="text" value=""></td>
</tr>
<tr>
<td class="loc l40 ">sdfsdf</td>
<td class="loc l40 " style="text-indent: 0; padding:0;">
<input id="input_40_21_1_2011_Orderdsfsds_a" type="text" value=""></td>
</tr>
<tr>
<td class="loc l40 ">sdfsdfsdfsdf</td>
<td class="loc l40 " style="text-indent: 0; padding:0;">
<input id="input_40_21_1_2011_sdfsdfOrders_a" type="text" value=""></td>
</tr>
</tbody>
</table>

JavaScript

$( function () {
    var $inputs = $('#locationsTable input[type=text]');
    
    $inputs.keydown( function( ev ) {
        if ( ev.which != 13 )  {
            return;
        }
        $inputs[ $inputs.index( this ) +1 ] && $inputs[ $inputs.index( this ) +1 ].focus();
    } );
} );