-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconditions in js.html
More file actions
48 lines (42 loc) · 1004 Bytes
/
conditions in js.html
File metadata and controls
48 lines (42 loc) · 1004 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
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script type="text/javascript">
var d= new Date()
var time = d.getHours()
var theDay = d.getDay()
if (time>19){
document.write(" <h3> Good evening to all students of AKTU </h3> ")
}
if (time==13) {
document.write(" <h3> Lunch-time! </h3> ")
}
else if (time>12 && time<16){
document.write(" <h3> Good afternoon to all students of AKTU </h3> ")
}
else
{
document.write(" <h3> Hello World! </h3> ")
}
switch (theDay) {
case 5:
document.write("Finally Friday, sports lecture")
break;
case 6:
document.write("It's Saturday, tomorrow is Sunday")
break;
case 0:
document.write("Sleepy Sunday")
break;
default:
document.write("I'm waiting for Activity lecture")
break;
}
</script>
</head>
<body>
</body>
</html>