+ 5

Help me! uncaught typeError 😥

In my previous code 'click me digital clock' There is an error. Run it and it will show the error. tell me how to correct it..Thanks in advance

14th Sep 2017, 8:01 AM
Abhineet Singh
Abhineet Singh - avatar
3 odpowiedzi
+ 11
just put your code in this window.onload = function boot() { //your code } https://code.sololearn.com/WGgPNa81hRp4/?ref=app
14th Sep 2017, 8:08 AM
Lord Krishna
Lord Krishna - avatar
+ 5
soloLearn code-playground has some bugs. also javascript not recognize html DOM elements until the document load completely you have to use like @Lord Krishna's method OR use js code under your html code.. like this. https://code.sololearn.com/WrpFAFPtyGGg/?ref=app
14th Sep 2017, 8:57 AM
Akbar Khalilzadeh
Akbar Khalilzadeh - avatar
+ 4
@lord kirshna Your code have a problem that runs printTime() automatically ( without onclick event).
14th Sep 2017, 10:14 AM
Abhineet Singh
Abhineet Singh - avatar