-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathifElseDemo.html
More file actions
36 lines (33 loc) · 779 Bytes
/
Copy pathifElseDemo.html
File metadata and controls
36 lines (33 loc) · 779 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Java Script If Else Statement</title>
</head>
<body>
<script>
var now= new Date();
document.writeln("<h2>"+ now+" </h2>");
var dayofweek = now.getDay();
if(dayofweek == 5)
{
document.writeln("Have a nice weekend!");
}
else
{
document.writeln("Have a nice day!");
}
var a,b;
a=parseInt(prompt("Enter First Number :"));
b=parseInt(prompt("Enter Second Number :"));
if(a > b)
{
document.writeln("<h2>"+a + " is Greatest");
}
else
{
document.writeln("<h2>"+b + " is Greatest");
}
</script>
</body>
</html>