To do that you need to use the HTML
defer attribute on the script element. Defer means that the code inside the
main.js file won’t run until after the web page has finished loading all its content elements (text, images, links, etc.).