+ 1
[HELP] Selectioning in Js don't work
Hello everyone , i'm really sorry because this is a really newby question and this is supposes to be so simple but i just can't figure this out :( . Why do the code send back "null" to this ?? This is really disturbing and blocking me on another more complex code .. Thank you very much https://code.sololearn.com/WKiI93U9vrv7/?ref=app
5 Answers
+ 10
Yes, you can also use any alternative onload event, i recommend to read something about.
Also, you can omit an onload event and put all your code after the <body> in a <script> tag, not the best practice.
Also, you can omit an onload event initializing global variables after the <body> in a <script> tag and put your main content elsewhere, maybe adding event inside tags, such as:
<body onclick="func()"></body>
The best practice is separate the HTML content from the JS content and use an onload event.
In your environment you can put the <script src="file.js"> after the <body> element, in Sololearn (until you use an external source) you can't, CodePlayground uses tabs!
+ 11
Just the onload event.
https://code.sololearn.com/Wq5ut8Su1lIb/?ref=app
+ 8
My pleasure!
+ 1
Thank you very much
0
Alright thank you very much ! But is this necessary because i'm coding via SL app ? Because i have never done such a thing when i code on my computer's environment