Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 3
What is the difference between placing the <script> or <style> tags INside or OUTside the <head> or <body> tags?
I wrote this example to illustrate my question. Notice that the <script> and <style> tags are NOT placed inside the <body> OR the <head> and it still works. Why is this style of programming not mentioned in the "JS Main Course"? Does it make a difference? https://code.sololearn.com/WqXwV16OJpFx/?ref=app
4 Answers
+ 3
JavaScript is a known language to freely allow mistakes, it is more correct to put <script> in the <head> section, yet practically doesn't matter mostly.
0
So it is more like a coding standard to ensure consistency. Thank you! :)
0
Yup! Make sure to mark my answer as best if it satisfied you 😉
0
👍