Skip to content

Commit

Permalink
Create index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
ShoroukAziz authored Jun 16, 2020
0 parents commit 484be4a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<html>
<head>
<title>Greeting Message using JavaScript</title>
</head>
<body>
<label id="lblGreetings"></label>
</body>

<script>
var myDate = new Date();
var hrs = myDate.getHours();

var greet;

if (hrs < 12)
greet = 'Good Morning';
else if (hrs >= 12 && hrs <= 17)
greet = 'Good Afternoon';
else if (hrs >= 17 && hrs <= 24)
greet = 'Good Evening';

document.getElementById('lblGreetings').innerHTML =
'<b>' + greet + '</b> Shorouk!';
</script>
</html>

0 comments on commit 484be4a

Please sign in to comment.