javascript after page load event listener code example
Example 1: wait for page load js
window.addEventListener('load', function () {
})
//THE OTHER ANSWER IS WRONG (has a syntax error)
Example 2: html tag run only after whole page is loaded
<body onload="script();">
<!-- will call the function script when the body is load -->