JSFiddle - React, Tailwind, and code Playground

HTML

<input name="productkey1" type="text" id="productkey1" size="4" maxlength="5"/> - <input name="productkey2" type="text" id="productkey2" size="4" maxlength="5"/>

JavaScript

$('#productkey1').keyup(function() {
	 if(this.value.length == $(this).attr('maxlength')) {
		 $('#productkey2').focus(); 
		}
	});