+ 2
In javascript tutorials the <script> </script> tags are not in the html section of the coding playground why is this?
Javascript Tutorials where is the <script> </script> tags
5 Answers
+ 4
In Sololearn you can write in JS section then it will be automatically loaded in html head section
+ 2
You could add script in the head or body tag of html section too.
The sequence of execution is scripts from head tag would be ran first, followed by scripts from JavaScript section without waiting for DOM elements fully loaded.
Normally we would add our scripts in the body tag of html section or in the JavaScript section, where DOM is ready to be accessed.
To learn the sequence, try to run this code.
https://code.sololearn.com/W8qiO41gHNfu/?ref=app
+ 1
Ok so when I'm not using the playground I do include the <script> </script> tags in the html file?
+ 1
Yes iratedreamer, when you are not in the Sololearn Playground you should include tha <script> tag.
+ 1
Thanks everyone.