Javascript Welcome

1,573 Kb

How do I make an 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 03 September 2022, Saturday.

Javascript Welcome Previews

Javascript Welcome - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Javascript Welcome</title>
<body> <script src="js/index.js"></script>

Javascript Welcome - Script Codes 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>');
Javascript Welcome - Script Codes
Javascript Welcome - Script Codes
Home Page Home
Developer Peter Lewicki
Username peterlewicki
Uploaded September 03, 2022
Rating 3
Size 1,573 Kb
Views 48,576
Do you need developer help for Javascript Welcome?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Peter Lewicki (peterlewicki) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!