There’s another way to write this code ? I think it’s kinda unprofessional and messy
Basically the code submit a form by “Enter key” and mouse “Click” so there’s another way ?
$("#form-signup-login input#login-submit").click(function()
{
doLogin();
});
$('input#login-request-username-email, input#login-request-password').keyup(function(e){
if(e.keyCode == 13)
doLogin();
});
Thanks for your time!
Explanation:
getElementByIdmethod which is faster than the sizzle engine.Alternatively bind form submit which takes care of all this by default for you..