Javascript Welcome

A simple javascript code that greets the user with a different greeting, depending on the time of day. What is a javascript welcome How do you make a javascript welcome? This script and codes were developed by Peter Lewicki on 07 November 2021, Sunday.

How do I make an javascript welcome?
  1. Javascript Welcome Previews
  2. Javascript Welcome HTML Codes
  3. Javascript Welcome JS Codes
Javascript Welcome Previews

Javascript Welcome HTML Codes

<!DOCTYPE html>
<html >
  <meta charset="UTF-8">
  <title>Javascript Welcome</title>

    <script src="js/index.js"></script>


Javascript Welcome JS Codes

//setting up time and date variables
var today = new Date();
var time = today.getHours();
var greeting;

//code below sees what time it is and spits back greeting
if (time > 18) {
  greeting = 'Good Evening!';
} else if (time> 12) {
  greeting = 'Good Afternoon!';
} else if (time > 0) {
  greeting = 'Good Morning!';
} else {greeting = 'Welcome!';
document.write('<h3>' + greeting + '</h3>');
Do you want hide your ip address?Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup.