Help | SoloLearn: Learn to code for FREE!



Why my clock doesn't display?

3/3/2021 9:03:44 AM


2 Answers

New Answer


From line 43 through 45 replace 'new' with 'now'. 'now' is a variable defined at line 11. Basically you mistyped the variable identifier. If you find yourself unable to figure out what's is wrong with your code try to take a break and come back to it later.


/* var sec=new.getSeconds(); var min=new.getMinutes(); var hr=new.getHours(); */ var datenow = new Date(); var sec=datenow.getSeconds(); var min=datenow.getMinutes(); var hr=datenow.getHours();