-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotpDabitcard.html
79 lines (74 loc) · 1.72 KB
/
otpDabitcard.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
<!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>Document</title>
<style>
body{
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.main{
width: 400px;
box-shadow: 10px 10px 5px gray;
margin: auto;
text-align: center;
padding: 10px 5px;
background-color: #f8f7f5;
}
</style>
</head>
<body>
<div class="main">
<div>
<h1>OTP</h1>
</div>
<p>Please Wait you Otp is Genrating...</p>
<p id="otp"></p>
<div id="input">
</div>
</div>
<script>
let count=1;
let myInterval= setInterval(function(){
count++;
document.getElementById('otp').innerText=count;
if(count==4){
myStopFunction();
}
}, 1000)
function myStopFunction() {
clearInterval(myInterval);
submitData();
}
function submitData(){
let inputData=document.getElementById('input');
let dir=`<input type="text" id='myotp'>
<input type="submit" value="Submit Your Otp" id='suc'>`
inputData.innerHTML=dir;
last();
}
function last(){
document.getElementById('suc').addEventListener('click',function(){
let ottp= document.getElementById('myotp').value;
if(ottp=='1234'){
let conf=confirm('Paymet Succesfully Do you Want to go home page')
if(conf){
window.location.href='index.html';
}
else{
window.location.href='cart.html'
}
}
else{
window.location.href='signup.html'
}
})
}
</script>
</body>
</html>