dom on page load code example
Example 1: js on page loaded
window.onload = function() {
yourFunction(param1, param2);
};
Example 2: on dom load js
window.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
});