Code Playground | SoloLearn: Learn to code for FREE!

+1

Code Playground

Personally, I don't really like writing JavaScript inside HTML. I like it in it's separate file. But for some reason, the Sololearn Code Playground for web really has issues against this. When writing JavaScript separately from the HTML there are a lot of errors. But when I write the same code in HTML inside <script> tags, it works like a charm, and this really ticks me off. What causes this?

5/17/2020 7:18:56 PM

Thomas Sankara

4 Answers

New Answer

+3

This may shine some extra light on what is the cause of your problems. https://code.sololearn.com/WcdoF4PGPyDC/#html

+2

Just an exceeding solution is : window.onload = () => { // all your javascript code goes here }

+1

this might help: https://www.sololearn.com/Discuss/2298680/?ref=app

0

Ookay 🤔. Now I understand it. Thanks