the code for the day is not running. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

the code for the day is not running.

<html> <head><title>greetings</title> <body> <script language = "JavaScript"> var name = prompt("Please enter your name","name"); var today = new Date(); var hours = today.getHours(); if (hours <= 12) document.writeln("Good Morning" + " " + name); else if (hours <= 18) document.writeln("Good Afternoon" + " " + name); else document.writeln("Good Evening" + " " + name); document.writeln("<br>"); var day; var date; var now; var arr = new Array(7); arr[0] = "Monday"; arr[1] = "Tuesday"; arr[2] = "Wednesday"; arr[3] = "Thursday"; arr[4] = "Friday"; arr[5] = "Saturday"; arr[6] = "Sunday"; now = new Date(); date = now.getDay(); document.writeln("It's" + " " + arr[date]); </script> </body> </html>

18th May 2019, 6:22 AM
Abhinav Joshi
Abhinav Joshi - avatar
1 Answer
+ 2
Abhinav Joshi Please, be more specific on the running problem... Futhermore i want remember you than you can attach your code into comment simply by copy/paste the url of your CodePlayground saved code without copy all the code (a really useful feature then lets to use it) like: https://code.sololearn.com/WaVusr8J1KvK/?ref=app
18th May 2019, 6:49 AM
KrOW
KrOW - avatar