It’s fine to put the JS links at the bottom of the HTML, just before the tag.
Otherwise you need some extra JS to tell the script only to run when the page has loaded..
How do I know if a HTML page is loaded?
Which is the alternative to the load event?
DOMContentLoaded and readystatechange are alternatives to the load event: they are triggered sooner, when the document and its elements are ready to manipulate, but before external resources are fully loaded.
Should jQuery be in head or body?
It’s always a good practice to add jQuery code in footer i.e. just before the closing tag. If you have not done that, then use the defer attribute. The defer attribute is used to specify that the script execution occurs when the page loads.