+ 1
Where should we place the JS scripts?
So far, I've learnt that placing the JS scripts in the <head> or/and <body> will delay the subsequent html elements from loading. This is because <script> tags loads first. If you want your HTML page to load fast and timely, i. e. if you want your <head> and <body> sections to load, then you must place you JS scripts after the </body> tag.
2 ответов
+ 1
You can place your js script just before the closing body tag,as it allows all html to be loaded first
0
Both are correct, it all depends on whether you need to use it before the page loads or after.