-
Notifications
You must be signed in to change notification settings - Fork 1
/
otpwalson.html
83 lines (75 loc) · 1.77 KB
/
otpwalson.html
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OTP Verification</title>
<style>
.content2 input{
margin-top: 1%;
margin-bottom: 2%;
height: 40px;
width: 400px;
border-radius: 5%;
margin-left: 5%;
display: block;
margin: auto;
}
.content2{
height: 600px;
width: 70%;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 20px;
margin: auto;
margin-top: 15%;
}
#submit{
display: block;
width: 10%;
background-color: #FF7B73;
color: white;
border: none;
font-size: 20px;
margin-top: 1%;
}
h5{
margin-left: 44%;
}
p{
margin-left: 43.5%;
}
</style>
</head>
<body>
<div class="content2">
<form action="" id="otpform">
<h5>Please Enter OTP</h5>
<input type="password" name="" id="otp" placeholder="Enter OTP">
<input type="submit" id="submit">
<p></p>
</form>
</div>
</body>
</html>
<script>
document.querySelector("#submit").addEventListener("click",submit)
function submit(event){
event.preventDefault()
var otp = document.querySelector("#otp").value;
n = Number(otp)
for(var i = 0; i<n; i++){
if(n == 123){
var p = document.querySelector("p")
p.textContent = "You entered correct otp"
p.style.color = "green"
window.location.href="page4(sucessfull).html"
}
else{
var p = document.querySelector("p")
p.textContent = "Enter Vaild OTP"
p.style.color = "red"
}
}
}
</script>