window.addEventListener('DOMContentLoaded', (event) => { myFunction(); }); // Once the DOM has been loaded, the function will run