Computer Science, asked by vidhisharma58251, 1 year ago

Write html markup for a webpage morning text at the top of page

Answers

Answered by anju2730
3

Hlo mate ❤

here is ur answer ⏬

<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';

I hope it help u ☺.

Similar questions