Apart from what michaelsndr already correctly said, there is another thing that you should consider.
The scripts should be the last thing you put in the body (basically just before the closing tag of the body).
This is because they are the last thing that should be loaded.
Sometimes this could take quite a bit of time and if you put them at the beginning, the rest of the page won’t load untill the scripts have loaded. And you want the user to see the content as soon as possible.
Another important thing: before doing any changes to the DOM (the Object that reflects the content of the page) via JavaScript you need to be sure that the content has loaded. You could do this with the jQuery $( document ).ready()
function or with the vanilla JS document.onload function.