-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
75 lines (66 loc) · 1.71 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Even Odd</title>
<style>
*{
font-size: 40px;
font-family: Arial, Helvetica, sans-serif;
}
body{
background-color: #EDEADE;
}
#nav{
top: 0px;
background-color: black;
height:50px;
}
#nav a{
color: white;
text-decoration: none;
margin: 20%;
}
#nav a:hover {
border-bottom: 2px solid;
}
</style>
</head>
<body>
<center>
<div id="nav">
<a href="#">Home</a>
<a href="aboutus.html">About Us</a>
</div>
<h1>Even Odd App</h1>
<form onsubmit="find()">
<label for="num">Enter Number</label>
<input type="number" placeholder="Only Integer" id="num">
<br><br>
<input type="submit" value="Find">
</form>
<h2 id="msg"></h2>
</center>
<script>
function find()
{
event.preventDefault();
let num=document.getElementById("num");
let msg=document.getElementById("msg");
let ans=""
if(num.value=="")
{
alert("Please Enter Number First");
msg.innerHTML="";
num.focus();
return;
}
else {
ans=num.value%2==0?"Even":"Odd";
}
msg.innerHTML=ans;
}
</script>
</body>
</html>