JSFiddle - React, Tailwind, and code Playground

by Shaunak Deshpande

HTML

<input type="text" class="inputs" maxlength="4"/>
<input type="text" class="inputs" maxlength="4"/>
<input type="text" class="inputs" maxlength="4"/>

JavaScript

$(".inputs").keyup(function () {
        if (this.value.length == this.maxLength) {
          $(this).next('.inputs').focus();
        }
  });