0
What would happen if we use <script> within the <head> and <body> tags?
Normally it's used only within either of the two. Can you run separate JavaScript codes from two different tags?
2 ответов
+ 1
If you include <script> tag within <head> tags, your javascript file will be included and compiled before touching html code. If you include <script> within body or as a best practice, in the end of <body> all the HTML code will be parsed first and then Javascript will be compiled and linked to HTML tags. However, using <script> inside <head> or <body> is based on the type of programme or the functionalities you want to achieve.
0
Thanks!