JSFiddle - React, Tailwind, and code Playground

HTML

<form method="post" action="/" id="login">
	<input type="text" name="email" placeholder="E-Mail" autocomplete="off" required />
	<input type="text" name="password" placeholder="Пароль" autocomplete="off" required />
</form>

JavaScript

var form = '#login';
var mail = '[name=email]';
var pass = '[name=password]';

$(mail).keypress(function(e){
	if (e.which == 13 && $(pass).val() == '' && this.value.length > 2) $(pass).focus();
	else if (this.value.length > 2 && $(pass).val() != '') $(form).submit();
});

$(pass).keypress(function(e){
	if (e.which == 13 && $(mail).val() == '') $(mail).focus();
	else if (this.value.length > 5 && $(mail).val() != '') $(form).submit();
});