Categories
Programming lessons

A Simple html code to welcome visitors to your website

Spread the love
0
(0)

Welcome to this new post which we will put this code that welcomes your website visitors according to time.
What’s the point of it?
Honestly, I liked the category of these codes because they beautify the site so much, that’s why I designed this model to put it on top of the blog.
Code
Please copy the code correctly and place it in position without modification.
  
var welcome;  
var date = new Date();  
var hour = date.getHours();  
var minute = date.getMinutes();  
var second = date.getSeconds();  
if (minute < 10) {   minute = "0" + minute;   }   if (second < 10) {   second = "0" + second;   }   if (hour < 12) {   welcome = "good morning";   18. } else if (hour < 17) {   welcome = "good afternoon";   } else {   welcome = "good evening";   }   document.write("

” + “” + welcome + “” + ” welcome to our website”);  
document.write(“
” + hour + “:” + minute + “:” + second);  
  
  

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

2 replies on “A Simple html code to welcome visitors to your website”

Leave a Reply

Your email address will not be published. Required fields are marked *

 
Live Chat

Hi, Your satisfaction is our top priority, we are ready to answer your questions...