+ 1

Hello Solos, Can someone tell me what is wrong with my code because its not printing anything😢

Its my Javascript first code, I wrote it from scratch with the help of few tutorios from the internet but I don't understand why its not printing out anything😭😭 https://code.sololearn.com/WOLHw7voZFP6/?ref=app

13th Jul 2017, 9:31 PM
Raz
Raz - avatar
3 Answers
+ 2
1. setTimeOut waits and calls the function, but it's not repeated. You should use setInterval 2. You don't set the time, only the date 3. I made some other changes, check it from https://code.sololearn.com/W1qc5Vf9qaqY
13th Jul 2017, 10:20 PM
AndrĂŠs04_ve
AndrĂŠs04_ve - avatar
+ 1
To begin with getElemetsByClassName stores the elements in an array. so you should write date[0] to refer to the first element that is found. Also you have written two functions but you never call them.
13th Jul 2017, 10:10 PM
Giannis Tsirovasilis
Giannis Tsirovasilis - avatar
+ 1
@Giannis thank you so much I forgot about function calling @ Andres04_ve thanks buddy for the extra info ;-)
16th Jul 2017, 5:33 PM
Raz
Raz - avatar