Why is JavaScript code section not working in my program ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is JavaScript code section not working in my program ?

Can anybody help me out with this?

8th Dec 2019, 5:58 AM
Sneha Purkayastha
Sneha Purkayastha - avatar
3 Answers
+ 3
Okay thank you so much ๐Ÿ™‚
8th Dec 2019, 6:03 AM
Sneha Purkayastha
Sneha Purkayastha - avatar
+ 2
It's known issue with SL editor. Code from JS tab run before html loads. If you are trying to manipulate DOM elements using js. You'll receive error message "can't read property of null" etc. Refer this post it explains how to solve this problem : https://www.sololearn.com/post/90825/?ref=app
8th Dec 2019, 6:01 AM
๐Ÿ‡ฎ๐Ÿ‡ณOmkar๐Ÿ•‰
๐Ÿ‡ฎ๐Ÿ‡ณOmkar๐Ÿ•‰ - avatar
+ 1
Try to put your code here (in js section): window.onload = function() { write your code here }
8th Dec 2019, 6:30 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar