I have a JavaScript / JQuery code that I also wanted to execute the function or click the button, or the button to be pressed with the enter when typing. Detail that this is just a test I'm doing, nothing serious, it's not a login system or anything like that. Here is the code:
$("#btIr").click(function(){
const inLogin = $("#inLogin").val();
const inSenha = $("#inSenha").val();
if (inLogin === "admin" && inSenha === "jb2303") {
window.location.href = "cadastro_de_produtos/index.html"
} else {
alert("Login e/ou senha não conferem");
$("#inLogin").focus();
return
}
});
How do I activate the function by enter too?