-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
76 lines (67 loc) · 1.92 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vote Checker</title>
<style>
body{
display: flex;
justify-content: center;
align-items: center;
margin: 0%;
padding: 0%;
box-sizing: border-box;
height: 90vh;
}
.agechecker{
padding: 10px;
margin: 5px;
border: 1px solid black;
text-align: center;
border-radius: 20px;
}
.container{
border: 1px dotted black;
padding: 10px;
margin: 5px;
text-align: center;
border-radius: 9px;
}
input[type="number"],input[type="text"],button{
width: 70%;
text-align: center;
padding: 5px;
font-size: 1.5rem;
background: rgb(222, 220, 220);
margin: 5px;
border-radius: 20px;
}
button{
background: greenyellow;
border-radius: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>Check if you are eligible to vote or not.</h1>
<div class="agechecker">
<input type="number" name="age" id="age" placeholder="Enter Your Age"> <br>
<button onclick="check()">Check If You Are Eligible To Vote Or Not!</button> <br>
<input type="text" name="result" id="result" readonly="">
</div>
</div>
</body>
<script>
function check(){
var number = document.getElementById("age").value;
if(number>=18){
document.getElementById("result").value = "You are eligible to vote.";
}
else if(number<18){
document.getElementById("result").value = "You are not eligible to vote.";
}
}
</script>
</html>