1/* javascript function is executed after 5 seconds page was loaded */
2window.onload = function() {
3 setTimeout(loadAfterTime, 5000)
4};
5
6function loadAfterTime(){
7 document.getElementById("menu").style.display="block";
8}
1//put your JS code in
2document.onload = function {
3 // the code here will run when all the HTML is loaded (but the css and the images may miss)
4}
5
6// or in
7window.onload = function {
8 // the code here will run when the whole page is loaded (including css and images)
9}
1<body onload="script();">
2<!-- will call the function script when the body is load -->