add a load event to a dom element code example Example: window onload function load(argument) { // body... } window.onload = load;