write-ups-challenges-2020-2021/break_the_gate/script/2.js

19 lines
380 B
JavaScript
Raw Normal View History

2022-11-24 17:03:20 +00:00
function authenticate() {
if (userDb[$('#inp_user').val()] == $('#inp_passw').val()) {
sendAuth({thisUser: userDb[$('#inp_user').val()]}, goNext, errorAnimation);
} else {
errorAnimation();
}
}
$(document).ready(function(){
$('#submit').click(function(){
authenticate();
})
$(document).on('keypress',function(e) {
if(e.which == 13) {
authenticate();
}
});
})