xxxxxxxxxx
/* When a script contains functionality that
requires interaction with the DOM, the defer
attribute is the way to go. This way, it ensures
that the entire HTML file has been parsed before
the script is executed. */
<script src="example.js" defer></script>