Javascript to wish “Good Morning”

WISHES FOR A DAY

/* This script will display A “Good Morning” Message if the time is less than or equal to 10.Otherwise, it display a “Message Good Day”*/

[js]
<html>
<body>
<script type="text/javascript">
var d = new Date();
var time = d.getHours();
if (time <= 10)
{
document.write("<h1>Hai Good morning!!!</h1>");
}
else
{
document.write("</h1>Good day!!!!!!!</h1>");
}
</script>
</body>
</html>
[/js]

It produces the output as :

if the time is <=10

Hai!!!!Good morning

otherwise

Good day!!!!!!!

No comments yet.

Leave a comment

Request a Free SEO Quote