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