+ 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

18th Feb 2019, 8:05 PM
iratedreamer
iratedreamer - avatar
5 Respostas
+ 4
In Sololearn you can write in JS section then it will be automatically loaded in html head section
18th Feb 2019, 8:13 PM
Maneren
Maneren - avatar
+ 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
18th Feb 2019, 9:38 PM
Calviղ
Calviղ - avatar
+ 1
Ok so when I'm not using the playground I do include the <script> </script> tags in the html file?
18th Feb 2019, 8:15 PM
iratedreamer
iratedreamer - avatar
+ 1
Yes iratedreamer, when you are not in the Sololearn Playground you should include tha <script> tag.
18th Feb 2019, 8:19 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 1
Thanks everyone.
25th Feb 2019, 2:41 AM
iratedreamer
iratedreamer - avatar