Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Use DOMContentLoaded to make sure the DOM is ready and loaded

- The [TODO: Code shorthand span ] event can be used to make sure the DOM is loaded. - Note that external resources like images may not be loaded at that point. - via : https : //javascript.info/onload - ondomcontentloaded

Example :

js
function kickoff() {
    console.log("kickoff")
}
        
document.addEventListener("DOMContentLoaded", kickoff);

You can also do it with an anonymous funciton :

js
document.addEventListener("DOMContentLoaded", () => {
    console.log("DOMContentLoaded")
});