I am getting an error in line 16.I already declared time still I am getting error. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I am getting an error in line 16.I already declared time still I am getting error.

https://sololearn.com/compiler-playground/WbA0f5MRjd5K/?ref=app

26th Mar 2024, 7:13 AM
Raj Singh
Raj Singh - avatar
3 Answers
+ 3
You need to pay attention to what the error is telling you. With the Sololearn compiler, it'll load all the JavaScript tab first, which means none of your HTML fields 'exist'. To avoid this, you have 2 options, wrap your JavaScript tab in window.onload or put the JavaScript in a script tag at the end of your HTML code.
26th Mar 2024, 7:25 AM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Thanks have a great day
26th Mar 2024, 7:34 AM
Raj Singh
Raj Singh - avatar
+ 2
No problem, happy to be able to help.
26th Mar 2024, 2:12 PM
Ausgrindtube
Ausgrindtube - avatar