-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (29 loc) · 849 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$(document).ready(function () {
const _PIN = 1234;
const input_value = $("#password");
//disable input from typing
$("#password").keypress(function () {
return false;
});
//add password
$(".calc").click(function () {
input_value.removeClass("pin-login__text--error");
let value = $(this).val();
field(value);
});
function field(value) {
input_value.val(input_value.val() + value);
}
$("#clear").click(function () {
input_value.val("");
});
$("#enter").click(function () {
if(input_value.val() == _PIN){
window.location.href = 'accountType.html';
}
else {
input_value.val("");
input_value.addClass("pin-login__text--error");
}
});
});