javascript first loading page code example
Example 1: window.onload execute after load page
/* javascript function is executed after 5 seconds page was loaded */
window.onload = function() {
setTimeout(loadAfterTime, 5000)
};
function loadAfterTime(){
document.getElementById("menu").style.display="block";
}
Example 2: wait for page load js
window.addEventListener('load', function () {
})
//THE OTHER ANSWER IS WRONG (has a syntax error)