QUESTION SOLVED. Thanks eicto!
Friends, help me figure it out, I'm completely confused
The function checks the login / password form. If login> = 3 characters and focus on this form, then when you press Enter or Tab, the flipform () function should start
There are no errors in the console, flipform () itself works flawlessly. But when you press Enter or Tab, flipform () always works only when exactly 3 characters are written in the login form. If more - for some reason, it works by double-clicking on Enter
I have no idea why such bizarre symptoms
$(function() { var login = $("input[id='frontloginform']"); var password = $("input[id='frontpasswordform']"); login.keyup(function(){ if (login.val().length>=3 && login.is(":focus")) { $("#enter").css("display", "block"); $(function(){ $("#frontloginform").keydown(function(e) { if (e.which == 13){ //password.focus(); - если раскомментировать, то двойного нажатия не получится, и совсем работать не будет flipform(); } else if (e.which == 9){ flipform(); } }); }); } else{ $("#enter").css("display", "none"); } }); password.keyup(function(){ if (password.val().length>5) { $("#secondenter").css("display", "block"); } else { $("#secondenter").css("display", "none"); } }); });