JSFiddle - React, Tailwind, and code Playground

HTML

<form autocomplete="off" method="post" >
<table border="1" >
<form id="result" name="result" action="insert.php" method="post" autocomplete="off" onSubmit="return validateForm()" >

<th>product</th><th>serial</th>
<tr>
<td><input id="product1" type="text" name="product1"></input></td>
<td><input id="serial1" class="serial" type="text" name="serial1"></input></td>
<tr>
<td><input id="product2" type="text" name="product2"></input></td>
<td><input id="serial2" class="serial" type="text" name="serial2"></input></td>
<tr>
<td><input id="product3" type="text" name="product3"></input></td>
<td><input id="serial3" class="serial" type="text" name="serial3"></input></td>
<tr>
<td><input id="product7" type="text" name="product7"></input></td>
<td><input id="serial7" class="serial" type="text" name="serial7"></input></td>
<tr>
<td><input id="product8" type="text" name="product8"></input></td>
<td><input id="serial8" class="serial" type="text" name="serial8"></input></td>

</form>
</table>
<input type="submit" value="Update" name="submit"></input>
</form>

JavaScript

$('.serial').keypress(function(e) {
    console.log(this);
    if (e.which == 13) {
        $(this).closest('tr').next().find('input.serial').focus();
        e.preventDefault();
    }
});