JSFiddle - React, Tailwind, and code Playground

by Kai_Draord

HTML

<input type="text" id="firstElementId">
<input type="text" id="secondElementId">

JavaScript

document.getElementById('firstElementId').onkeypress = function(){
	var secondInputElement = document.getElementById('secondElementId');
  if(this.value && this.value.length > 6) {
  	secondInputElement.focus();
  }
}