0
Whats difference does it make to have the script tag in head and in body?
Wondering how would the OP vary with having Script tag in JS in heading and in body
1 Respuesta
+ 1
Putting script in the body allows the instructions to run after the elements preceding that spot to be loaded first. Functions in a script that is loaded before an element that it is attempting to manipulate will need a deferral mechanism (e. g. window.onload) to work properly.