Code Playground | SoloLearn: Learn to code for FREE!


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


This may shine some extra light on what is the cause of your problems.


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


this might help:


Ookay 🤔. Now I understand it. Thanks