JS styling not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

JS styling not working

Hello, I’m trying to make an object-oriented “game engine” type thing without using css and doing all the styling in JS but it isn’t working. https://code.sololearn.com/WWWRoPyd2KfY/?ref=app

3rd Apr 2021, 4:12 PM
caedmon
2 Answers
+ 1
Hello there! I resolved the problem by using the script tags and including the js in the html. https://code.sololearn.com/WncLY5s1T8j4/?ref=app A second solution is to onload the js using window.onload or other onload function :)
3rd Apr 2021, 4:20 PM
Matthew
Matthew - avatar
+ 1
Thank you very much!
3rd Apr 2021, 4:39 PM
caedmon