Display a Greeting message to your visitors based on Time - Link Short
News Update
Wait Generating Movie Link Click Below To Download...

Display a Greeting message to your visitors based on Time

We have seen websites greeting their visitors with a message that says Good morning, good afternoon or good evening, depending upon the time they visit the website. In fact, these are simple client scripts, which read the active visitors computer’s time. Here, in this article, I’ll show you how to greet your website visitors with a message. This article and the examples are for beginners.

Copy & Paste the Code

  <label id="lblGreetings"></label>

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

var greet;

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

document.getElementById('lblGreetings').innerHTML =
'<strong>' + greet + '</strong> and welcome to WapMash.xyz';
</script>

Share with your friends

Give us your opinion
How To Use
  • Put the link on the
  • Generate Link box with http:// or https://
  • Use  CTRL + V  on keyboard to put the link.
  • Click Generate button to get encrypted link.
  • Click Copy URL button.
  • Done