Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head><title>Countdown Event</title>
- <style type="text/css">
- body {background-image:url('scene.jpg');
- background-repeat:no-repeat;
- text-align:center;}
- h1 {font-size:40px;}
- </style>
- </head>
- <body>
- <h1> Christmas Countdown</h1><br><br><br><br>
- <SCRIPT LANGUAGE="JavaScript">
- <!-- Begin
- var date = new Date("June 8th, 2018");
- var description = "the end of school";
- var now = new Date();
- var diff = date.getTime() - now.getTime();
- var days = Math.floor(diff / (1000 * 60 * 60 * 24));
- document.write("<h1>")
- if (days > 2) {
- document.write(days + " days until " + description);
- }
- else if (days <= 2 && days > 1) {
- document.write("Only two days until " + description);
- }
- else if (days <= 1 && days > 0) {
- document.write("Tomorrow is " + description);
- }
- else if (days <= 0 && days > -1) {
- document.write("It's " + description + " ...Hooray!");
- }
- else {
- document.write("School is over loser.")
- }
- document.write("</h1>");
- // End -->
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement