Categories
Programming lessons

A Simple html code to welcome visitors to your website

Spread the love

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

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...