JSFiddle - React, Tailwind, and code Playground

by dying_sakura

HTML

<input id="Text1" class="form"  type="text"  />
<input id="Text2"  class="form" type="text" />
<input id="Text3"  class="form" type="text" />

JavaScript

function tab(e) {
    if (e.which == 13) {
        e.target.nextSibling.nextSibling.focus();
        e.preventDefault();
    }
}
var inputs = document.getElementsByClassName(".form");
for (var x = 0; x < inputs.length; x++)
{
    var input = inputs[x];
    input.onkeypress = tab;
}