DOMContentLoaded

The DOMContentLoaded event fires when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.

Stiven Castillo
June 13, 2023

The DOMContentLoaded event fires when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.

addEventListener("DOMContentLoaded", (event) => {});

onDOMContentLoaded = (event) => {};

https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event

Load event

The load event is fired when the whole page has loaded, including all dependent resources such as stylesheets, scripts, iframes, and images.

addEventListener("load", (event) => {});

onload = (event) => {};