0
I have a code in Javascript/Jquery that I wanted to also execute the function or when clicking the button, or that the button was triggered with enter when typing. Detail that this is just a test that I’m doing, nothing serious, it’s not a login system or anything like that. Follow 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 trigger the function by enter as well?